Results 1 to 3 of 3

Thread: SQL query..

  1. #1
    Junior Member
    Join Date
    Feb 2008
    Answers
    3

    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.


    Thanks and Regards
    Praful.



  2. #2
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    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

    Last edited by krishnaindia2007; 02-14-2008 at 05:06 AM.

  3. #3
    Junior Member
    Join Date
    Feb 2008
    Answers
    3

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact