Jump to content

SQL syntax: how to limit unique


PC Nerd

Recommended Posts

Hi,

 

Ive got a table of only 4 fields - but within a month will contain hundreds or thousands of records etc.

 

My Fields: `Location_ID`, `Item_ID`, `Area`, `Location`

 

the reason that there will be so many fields in such a short period of time, is that for every item there can be 10 or so areas, and for every area, there can be 10 or so Locations ( think of it as listing cities, and locations in cities)

 

I want to be able to simply gather a list of areas unique to that item.  ie - ignore the Location and only use the Areas per ITem:

"SELECT `Item_ID`, `Area_ID` FROM `item_loc` WHERE `Item_ID` = '".$ItemID."' WHERE... <condition>"    ?????

 

I dont know what to do with the condition.

 

 

Thanks for your help in advace

Link to comment
https://forums.phpfreaks.com/topic/113288-sql-syntax-how-to-limit-unique/
Share on other sites

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.