1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Query to fine blank records

Discussion in 'Oracle' started by dolphine4u, Jul 20, 2012.

  1. dolphine4u

    dolphine4u New Member

    Joined:
    Jul 20, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi All,

    I have a table with column Part_no, Revision, Alternative & Preferred

    Table data as below

    PART_NO REVISION ALTERNATIVE PREFERRED
    11000162 1 1 1
    11000162 2 1 1
    11000162 3 1 1
    11000162 4 1 1
    11000162 4 2 0
    11000162 5 1 1
    11000162 5 2 0
    11000162 6 1 1
    11000162 6 2 0
    11000162 7 1 1
    11000162 7 2 0
    11000162 8 1 1
    11000162 8 2 0
    11000162 9 1 1
    11000162 9 2 0
    11000162 10 2 0

    In above data you see part no has 10 revision where few revision has 1, 2 alternative and 1 alternative has preferred 1 & 2 alternative has preferred 0 so i want a query which check preferred only 0 how can i get this.
    Note: if alternative 1 preferred is 0 and if alternative 2 has 1 then i dont want to fetch such record. I want the output to show only prefererred 0.
    It should check how many alternative it has and all alternative should be 0 then only that revision data has to be displayed pls help

    TIA
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    >>In above data you see part no has 10 revision where few revision has 1, 2 alternative and 1 alternative has preferred 1 & 2 alternative has preferred 0 so i want a query which check preferred only 0 how can i get this.

    Well, I know YOU know what that means, cos you wrote it, but it makes no sense to me. Please split it into simple facts, for example:
    In above data you see part no has 10 revision where:

    few revision has 1, 2 alternative,
    1 alternative has preferred 1;
    2 alternative has preferred 0

    - or whatever it's meant to be.

    >>i want a query which check preferred only 0

    Again that doesn't make a lot of sense. Can you give the output you want to see from the query, for example should it be:

    PART_NO REVISION ALTERNATIVE PREFERRED
    11000162 4 2 0
    11000162 5 2 0
    11000162 6 2 0
    11000162 7 2 0
    11000162 8 2 0
    11000162 9 2 0
    11000162 10 2 0

    or something else?
     
  3. mialuzzatto

    mialuzzatto New Member

    Joined:
    Aug 5, 2015
    Messages:
    122
    Likes Received:
    4
    Trophy Points:
    0
    Occupation:
    Work at https://www.idevelopersquare.com
    Location:
    Waltham, MA, USA
    Home Page:
    Hello,

    Please follow these steps....

    Click any cell in the data range.

    Click the Data menu, and then click Filter | Advanced Filter. In Excel 2007 and 2010, click the Data tab and then click Advanced Filter in the Sort & Filter group.

    Retain the default setting; Filter the List In-Place.

    Excel automatically fills in the List Range, correctly in this case.

    Specify the Criteria range, A1:F2. You only need to identify the column headings.

    Click OK. The filter found just two records that meet both criteria expressions.
     

Share This Page