I'm struggling to find the syntax to create a view in this situation.
I'm joining a table to an existing view
create vwMyView as
** I want all these fields to end up as as field called, say summary
(vworganisationsemployees.title ||' '::text) ||
(vworganisationsemployees.firstname ||' '::text) ||
(vworganisationsemployees.surname ||'( '::text) ||
(vworganisationsemployees.occupation ||') '::text) ||
(vworganisationsemployees.organisation ||' '::text) ||
(vworganisationsemployees.branch ||' '::text) as summary
so far so good, as all the employees of the organisations will always contain
the data, however in the vwOrganisationsEmployees, some rows will not contain
the address of the branch ie fk_address is null, and the street and suburb
fields are null.
So at this point in the query it works ok, but I want also to add the address
of the branch into the summary field, and in some records there is no
fk_address and hence no street or suburb.
so I want to be able to conditionally test if fk_address is null, if it is,
then keep adding the street, suburb, postcode to the field which ends up being
Any help appreciated.
pgsql-novice by date
|Next:||From: vikas vashista||Date: 2009-10-23 06:27:57|
|Subject: Re: user defined data type|
|Previous:||From: Nathaniel Trellice||Date: 2009-10-22 14:40:22|
|Subject: Asynchronous commands|