Find invalid email formats using MySQL query.

2006-05-20 Thread Yesmin Patwary
Dear All, My contact table has email field which contains many invalid email addresses. I find them using following php function. Is there a way to do that check in MySQL query? function emailValidate ($str) { $reg = ^([a-zA-Z0-9._-]+)@([a-zA-Z0-9-])+(\.[a-zA-Z0-9-]+)+$; if

Find ids that are NOT in other two tables.

2006-05-19 Thread Yesmin Patwary
Dear All, Need to find ids that are NOT in other two tables. With the help of PHP scripting and three queries I am able to do the task. Can this be done with one mysql query? Below are current quires: SELECT DISTINCT company_id FROM company_db SELECT company_id FROM

Re: Find ids that are NOT in other two tables.

2006-05-19 Thread Yesmin Patwary
ON c.company_id = cu.company_id WHERE p.company_id IS NULL AND cu.company_id IS NULL; I am not sure if this join query will remove records from other tables. Jay Pipes [EMAIL PROTECTED] wrote: Yesmin Patwary wrote: Dear All, Need to find ids that are NOT in other two tables

INSERT...SELECT Query Help Request.

2006-03-22 Thread Yesmin Patwary
Dear All, First of all, I would like to thank Shawn Green, Peter Brawley and Josh for their kind help in my previous issue. I have a table named master_list with two field customer_id and list_code. I need to insert only non existent records in master_list from a child_list. Both

Re: Compare lists Query?

2006-03-13 Thread Yesmin Patwary
for your kind help and comments. Josh [EMAIL PROTECTED] wrote: 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

Problems with timestamp field after upgrading MySQL Server.

2006-03-13 Thread Yesmin Patwary
) 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 SELECT statements. --- Yesmin Patwary wrote: Dear All, I had some issues in past with timestamp fields as a result I am

Problems with timestamp field after upgrading MySQL Server.

2006-03-13 Thread Yesmin Patwary
) 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 SELECT statements. --- Yesmin Patwary wrote: Dear All, I had some issues in past with timestamp fields as a result I am

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

How to find Balance?

2005-08-04 Thread Yesmin Patwary
Dear All, I am trying to calculate balance for all id's. Can it be done using only one MySQL query (without any scripting, eg: php,perl,asp..)? price table: id|price 1|150 2|100 3|300 payment table: id|transaction_type|amount 1|PAID|75 1|PAID|25 1|REFUND|60 1|REFUND|30