Re: Compare lists Query?

2006-03-13 Thread Yesmin Patwary
Dear All, I had some issues in past with timestamp fields as a result I am unable to upgrade to mysql 4.1 version. I am sure below the query recommended by Josh works with 4.1 or above. Would it be possible to rewrite this query for 3.23 version? Again, thank you Josh and all others for

Re: Compare lists Query?

2006-03-13 Thread Peter Brawley
Yesmin Patwary wrote: Dear All, I had some issues in past with timestamp fields as a result I am unable to upgrade to mysql 4.1 version. I am sure below the query recommended by Josh works with 4.1 or above. Would it be possible to rewrite this query for 3.23 version? Again, thank

Re: Compare lists Query?

2006-03-13 Thread Josh
You could rotate the output... basically get 1 row with 11 columns (CA01_count,CA02_count,...,CA12_count) (leaving out CA10) joining all 12 tables together... Or... perhaps we can help with the timestamp issues you are having and get you upgraded to later version of mysql that supports nested

Compare lists Query?

2006-03-10 Thread Yesmin Patwary
Good morning all, We have 12 customer lists: CA01, CA02, ….,CA12. Table: customerList +---+--+ | list_name | id | +---+--+ |CA10 | 20BE | |CA07 | 20BE | |CA11 | 20BE | |CA03 | 20BE | |CA10 | NQCR | |CA04 | NQCR | |CA02

Re: Compare lists Query?

2006-03-10 Thread Josh
Here's one method: SELECT cl1.list_name, count(*) as count FROM customerList cl1 WHERE cl1.id IN (SELECT cl2.id FROM customerList cl2 WHERE cl2.list_name='CA10') and cl1.list_name != 'CA10' GROUP BY cl1.list_name --- Yesmin Patwary [EMAIL PROTECTED] wrote: Good morning all, We