Click to See Complete Forum and Search --> : selecting from one column, but getting two back


nemesis_256
03-10-2009, 04:18 PM
Alright. I have a table where all entries have a datetime field for when it was entered. I want to select from columnA with one date range, and then again with a second date range from the same column. In my result I want two separate columns returned. For selecting a date range I'm doing "columnA >= '2009-03-02 08:45:01' and columnA <= '2009-03-02 08:56:41'". Is it possible to add another range to get a second column returned?

This is MySQL BTW.

Phill Pafford
03-11-2009, 12:06 PM
You could use the UNION command (http://dev.mysql.com/doc/refman/5.0/en/union.html) to run multiple queries at once.