Reputation: 115
I have a table with two columns [Date], [StopName], i want to write a query which will show both columns as one column like e.g. 12/05/2007: Stop1. So far i was trying like this
SELECT Date + ':' + StopName as Departure from tbldept.
Any suggestion?
Upvotes: 0
Views: 3853
Reputation: 5714
SELECT to_char(Date, 'DD/MM/YYYY') || ':' || to_char(StopName) as Departure
from tbldept.
||
is concatenation operator just like in Oracle
UPDT fixed to avoid conversion errors
Upvotes: 1
Reputation: 79
You are right, in may get conversion failed error. In that case you need convert the column into a varchar data type.
Upvotes: 0