Forum Moderators: coopster & phranque

Message Too Old, No Replies

Combining datasets in mysql

how?

         

Clark

3:27 pm on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just read this in the mysql manual but can't remember where. There was something about combining datasets. I don't want to do a JOIN, all I want is all productids from two tables. Basically, I have active products in one table and inactive (archived products) in another table. Sometimes they overlap. I'm trying to get a list of all productids, if it shows up in the first table, great. If there's a productid in the archived table NOT in the active table, then I want that too.

I'm sure this is easy, but my brain is tired and the answer is not coming to me.

Thanks WW.

jatar_k

3:35 pm on Jun 13, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What about UNION [mysql.com]?

Though even though you dont want to join I would think you could do a SELECT DISTINCT JOIN.

Clark

4:54 pm on Jun 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, yup UNION was it... and I think you are right about SELECT DISTINCT being the answer... Maybe a cup of coffee will clear the fog even more (since I can't seem to get the 3 more hours sleep to = 8 today)