Welcome Guest, Not a member yet? Register   Sign In
SQL question / advice
#10

[eluser]nevsie[/eluser]
Hi guys, thanks for you above replies... but the OR part of the statement is where i am having the trouble... Or will effectively bring back rows which have one of those values...
I understand the need for the table structure, but it is literally as described above. It is a two column table which links products and categories (allowing products to be placed in more than one category).

Because Cat id is only mentioned once on each row, effectively i am looking to merge two rows where prod_id is the same, and where in each of these two rows cat_id equals the value...
The more i read an analyse this cannot be done with a single query, therefore i have had to go down the two query path and have a working example....
the first query brings back all product_ids for the first cat_id, the second bring back only prod_ids that are from the first query, and have the second cat id... not clean, not efficient, but it works!


Messages In This Thread
SQL question / advice - by El Forum - 10-23-2008, 12:06 PM
SQL question / advice - by El Forum - 10-23-2008, 01:11 PM
SQL question / advice - by El Forum - 10-23-2008, 01:20 PM
SQL question / advice - by El Forum - 10-23-2008, 01:24 PM
SQL question / advice - by El Forum - 10-23-2008, 01:47 PM
SQL question / advice - by El Forum - 10-23-2008, 01:53 PM
SQL question / advice - by El Forum - 10-23-2008, 01:56 PM
SQL question / advice - by El Forum - 10-23-2008, 02:25 PM
SQL question / advice - by El Forum - 10-23-2008, 07:50 PM
SQL question / advice - by El Forum - 10-24-2008, 02:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB