var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Combined result...
hi! can anybody please help me...what would be my query string if i want to combine 3 column into one column?
example. I have 3 columns in my customer table namely street,City,postal_code and i want to query that 3 column as address having it combined. thanks in advance.
well, daimous, it seems like you did not understand why i moved your previous thread to the microsoft SQL Server forum
so here is the SQL answer --
if you find that this doesn't work in SQL Server, i trust it will bring to your attention that SQL Server questions should be posted in the SQL Server forum and not the SQL forum
select street||City||postal_code as address
In SQL Server
This assumes that you have [postal_code] defined as a varchar, and not an integer or numeric field. I put in some spaces and a comma, so your output would be something like this:
Select [street]+', '+[city]+' '+[postal_code] as Address
Street, City Postal_Code
If you have NULL values in your table and are using default SQL Server settings, you may need to use this:
Select coalesce([street]+', ', '')+Coalesce([city]+' ', '')+Coalesce([postal_code], '') as Address
Now, go open up Books Online and read about concatenation and the COALESCE function.