Forum Moderators: open

Message Too Old, No Replies

odd table join search

         

kuper20

12:50 am on Jul 1, 2008 (gmt 0)

10+ Year Member



Hello,

So I have a certain search I want to do on two tables. The first table has a playerid and player info with that id. The second table has information with the playerid and a certain date they picked. Each playerid can have more than one date, so it's not a unique number in the second table like it is in the first. Now I want to have a SELECT query that joins the two tables, but only gets the players who have picked 2 of the certain dates available.

My problem is that when I do a join I get multiple instances of the player profiles for those 2 different dates if they select both of them. Is there a way to remedy this somehow?

It seems as though I've designed the second table so that it's easy to list off the dates the player has selected, but hard to go the other way around.

Thanks again

bmcgee

4:11 am on Jul 1, 2008 (gmt 0)

10+ Year Member



Use the HAVING clause along with a COUNT to get the ones that match 2 of the dates (or >= 2).