stig1 Posted November 18, 2010 Share Posted November 18, 2010 I want to have two select statements extracting the same data from the table, however the where case is different on each select statement, also want to sort the whole results from both queries as one, in ascending order. Can this be done? If so, how? Cause currently i run two separate queries, and it looks ugly when showing a list of data in wrong order. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/219043-multiple-select/ Share on other sites More sharing options...
vichu.1985 Posted November 18, 2010 Share Posted November 18, 2010 Dude, U might need to use union for this: Consider the following query select * from( select * from table_name where field1=value1 union select * from table_name where field2=value2) tab order by field3 Hope this will help you Link to comment https://forums.phpfreaks.com/topic/219043-multiple-select/#findComment-1135958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.