Question

I have this code

SELECT date(start_date) FROM `project` 
WHERE name = "Project_A"
UNION
SELECT date(end_date) FROM `project` 
WHERE name = "Project_A"

and the result is

1/2/2013
5/3/2014

What I want to happen is have kind of like a label for the date, the result I want is

Start | 1/2/2013
End   | 5/3/2014

i just want to have a label for the two rows, how can i do this?

Was it helpful?

Solution

do something like this:

SELECT 'START', date(start_date) FROM `project` 
WHERE name = "Project_A"
UNION
SELECT 'END', date(end_date) FROM `project` 
WHERE name = "Project_A"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top