Reputation: 1411
The SQL query in my PHP file is
SELECT start_time,end_time FROM data;
This returns the two varchar fields in two different columns. Now i wish to combine these. So I tried
Select start_time+' '+end_time as time from data;
This returns some numeric value. So I tried:
Select cast(start_time+' '+end_time) as time from data;
If the data in my table is start_time = 8:00 a.m end_time = 9:30 a.m
how can I display 8:00 a.m - 9:30 a.m.
Upvotes: 4
Views: 11328
Reputation: 21
SELECT CONCAT(start_time,' ',end_time) as time FROM TEBLENAME
Upvotes: 2
Reputation: 24609
Select CONCAT(start_time, ' - ', end_time) as time FROM data
Upvotes: 7