|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
selection matching
I am building a simple classifieds script. I have two tables, one for the categories of the classifieds, and another for the classifieds themselves. I want only the categories to display on the first page, and only categories who have someone signed up under them.
for example, if I have parts, ovens, tools, misc as my categories, and there are only people signed up under tools and oven, only tools and ovens should show up. I am not so hot yet at queries, but this is what I got so far: SELECT category.category, classifieds.categoryid FROM category, classifieds WHERE classifieds.categoryid = category.categoryid this brings them all up, could I get some help with this? |
|
#2
|
|||
|
|||
|
RE: selection matching
sounds like all of the numbers for these two fields are auto number. basically what you have told it to do is an informal JOIN, saying, join the fields of these two tables where this id equals this id. Of course, they both have the same number that matches at some point, hence you get everything form the tables for these two columns.
|
|
#3
|
|||
|
|||
|
RE: selection matching
ok, but I also only want it to show up once. so if there are members under tools, no matter how many members, I just want "tools" to show up once.
|
|
#4
|
|||
|
|||
|
RE: selection matching
And I do this by adding the 'distinct' statement to my select don't I?
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > selection matching |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|