Jump to content

select distinct variable and another variable


FUNKAM35

Recommended Posts

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

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.