-
SQL query..
Hi
I have a question regarding to sql query. Can any one do this.?
We have two tables tableA and tableB, In tableA there is 20,000 records and in tableB 8000 records present. All records in tableB are duplicate, i have a field "ipd_prod" that is either "bulk" or "prduct name" i want to check only "product name" . Some records of tableB is also present in tableA.
"I want to fetch that records which is not in tableB and `ipd_prod` <> (not ) "bulk" ." ?
what is the sql_query I write for that particular records.
:confused:
[I][SIZE="1"]Thanks and Regards
Praful.[/SIZE][/I]
-
Re: SQL query..
Dear Praful,
Try this query
SELECT fields from tablea
WHERE ipd_prod not in ( select distinct ipd_prod from table b )
AND ipd_prod <> 'bulk'
Regards
Krishna
-
Re: SQL query..
SELECT fields from tablea
WHERE ipd_prod not in ( select distinct ipd_prod from table b )
AND ipd_prod <> 'bulk'
this will print all data which is in tableB and not in tableA
I just replace tableA as tableB and tableB as tableA then it will so the data I required.
thanks for your suggetion