Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
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 AllSelect null, 2, null Union AllSelect null, null, 3
CoreyCo-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 ..."