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
Share on other sites

I know how to do conditions etc ive been workign with them non stop for 3 days

 

my questions is what should my cindition ( or SQL function etc) be to ensure that it completely ignores locations, and simply lists teh areas etc?

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.