Computing.Net > Forums > Programming > SQL - concatenate columns

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL - concatenate columns

Reply to Message Icon

Name: mossvector
Date: May 31, 2005 at 01:55:28 Pacific
OS: XP
CPU/Ram: 3GHz 1GB
Comment:

Hi, how do I query so results are displayed in 1 column, e.g. 2 columns: name and address - displaying in 1 field?

Any ideas appreciated!
Steve



Sponsored Link
Ads by Google

Response Number 1
Name: Acyf
Date: May 31, 2005 at 13:46:11 Pacific
Reply:

Select ColumnTitle = (Column1 + Column2) FROM Mytable WHERE (Column1 is not null) AND (Column2 is not null)

The reason for the Where clause, is because in some database engines (possibly all of them) you cannot concatenate NULL values. So those rows would be ommited from the results anyway.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: SQL - concatenate columns

SQL with Access 2000 www.computing.net/answers/programming/sql-with-access-2000/2010.html

SQL Three into 1 ! ( www.computing.net/answers/programming/sql-three-into-1-/7894.html

Renaming columns, sp_'s, triggers www.computing.net/answers/programming/renaming-columns-sps-triggers/6392.html