FUNKAM35 Posted May 6, 2014 Share Posted May 6, 2014 Hi I need to select a distinct variable $area from the table property I also need to select the variable $location from the same table so it gives the array $area/$location Select distinct area from property Select location from property where $area =`area` How can I string the two together Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/288289-select-distinct-variable-and-another-variable/ Share on other sites More sharing options...
ginerjm Posted May 6, 2014 Share Posted May 6, 2014 This makes no sense. How about explaining in plain English? Quote Link to comment https://forums.phpfreaks.com/topic/288289-select-distinct-variable-and-another-variable/#findComment-1478476 Share on other sites More sharing options...
gizmola Posted May 6, 2014 Share Posted May 6, 2014 All I can guess is that you want a list of distinct area/location combinations? SELECT DISTINCT area,location FROM property You can also accomplish this with GROUP BY SELECT area, location FROM property GROUP BY area, location Quote Link to comment https://forums.phpfreaks.com/topic/288289-select-distinct-variable-and-another-variable/#findComment-1478489 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.