Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Blank columns in a Union SQL

Author  Topic 

JasonD
Starting Member

6 Posts

Posted - 2005-11-14 : 10:23:39
I am creating an output file that is the result of the union of applicant data and employees.

The output file will contain name, seniority date etc.

Because it is a union join both selects on either side must be the same number of columns but there is no seniority date on the applicant table therefore I would like this column to be blank.

How do I achieve this in the SQL statement? Is there a way to place a blank literal in place of the field name in this specified column position?

We are using MS SQL.

Thanks.

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-11-14 : 10:28:11
how about null?


Select 1, null, null Union All
Select null, 2, null Union All
Select null, null, 3


Corey

Co-worker on children "...when I have children, I'm going to beat them. Not because their bad, but becuase I think it would be fun ..."
Go to Top of Page

JasonD
Starting Member

6 Posts

Posted - 2005-11-14 : 10:58:34
Thanks, that did the trick.
Go to Top of Page
   

- Advertisement -