Skip site navigation (1) Skip section navigation (2)

Text concat Problem

From: Luis Magaa <joe666(at)gnovus(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Text concat Problem
Date: 2000-11-08 23:49:46
Message-ID: SAK.2000.11.08.ilrgpgsp@thor (view raw, whole thread or download thread mbox)
Lists: pgsql-generalpgsql-novice

Have this curious situation and would like some help from you:

Create an employee table:

CREATE  TABLE  employee(
   id_employee SERIAL PRIMARY KEY,
   sex CHAR(1) DEFAULT 'm' CHECK(sex = 'f' OR sex = 'm'),
   start_date DATE NOT NULL,
   charge VARCHAR(50) NOT NULL,
   last_name VARCHAR(50),
   first_name VARCHAR(50) NOT NULL,
   title VARCHAR(10) NOT NULL

then fill it with a few values:

insert into employee(title,first_name,start_date,charge) values('Mr. X','Smith',date(now()),'None');
insert into employee(title,first_name,start_date,charge) values('Mr. Y','Smith',date(now()),'None');
insert into employee(title,first_name,start_date,charge) values('Mr. Z','Smith',date(now()),'None');

so far there is no problem at all, the problem comes here:

select title || ' ' || first_name || ' ' || last_name as fullname from employee;

 (3 rows)

Doesn't work !!!!, I'm thinking it is because of the null value in last_name.  Have any idea or suggestion on how to workaround this situation.

Thank you.

Luis MagaƱa
Gnovus Networks & Software
Tel. +52 (7) 4422425


pgsql-novice by date

Next:From: Stephan SzaboDate: 2000-11-09 03:49:09
Subject: Re: Text concat Problem
Previous:From: Poul L. ChristiansenDate: 2000-11-08 22:41:49
Subject: Re: migrating MSAccess to pgsql7.0 on RH 6.2 through odbc

pgsql-general by date

Next:From: Matt BeauregardDate: 2000-11-08 23:54:05
Subject: Re: Relation 'pg_user' does not exist
Previous:From: Tom LaneDate: 2000-11-08 23:45:15
Subject: Re: Relation 'pg_user' does not exist

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group