select query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • brettokumar
    New Member
    • Jul 2008
    • 31

    select query

    hai if im using this query

    SELECT PRODUCT_ID,ITEM _HEADING,IMG_NA ME
    FROM (SELECT DISTINCT A.PRODUCT_ID,A. ITEM_HEADING,B. IMG_NAME FROM EUS_SEL_ITEM A, EUS_IMAG B WHERE G1_NR ='12' AND A.PRODUCT_ID=B. PRODUCT_ID) temp
    WHERE rownum <= 3 ORDER BY rownum;

    i get a result like this
    PRODUCT_I ITEM_HEADING IMG_NA
    --------- -------------------------------------------------- ------
    10002689 Nature 00.JPG
    10002689 Nature 02.JPG
    10002912 aci hair oil 01.JPG

    but i need to get a result like
    PRODUCT_I ITEM_HEADING IMG_NA
    --------- -------------------------------------------------- ------
    10002689 Nature 00.JPG
    10002912 aci hair oil 01.JPG
    10002922 Tyers 01.JPG
  • ibrahim2008
    New Member
    • Nov 2008
    • 9

    #2
    The query you have written is right,but there may be some duplicate records,so that's why you are getting such records.i don't know what your tables are containing/just give your table details.


    Regards,
    Ibrahim

    Comment

    • brettokumar
      New Member
      • Jul 2008
      • 31

      #3
      hai ibrahim
      my table dosen't hav any duplicate records. but in my table a single id have multople image name like

      product_id img_name
      -----------------------------------
      IN1002321 00.jpg
      IN1002321 01.jpg

      like this only

      Comment

      • Pilgrim333
        New Member
        • Oct 2008
        • 127

        #4
        Hi,

        You have to add the criteria then on which image should be queried.

        Pilgrim.

        Comment

        • amitpatel66
          Recognized Expert Top Contributor
          • Mar 2007
          • 2358

          #5
          I would like you to do the following:

          1. Post sample data of the tables for few product
          2. From those sample data, please explain what you want as an output.

          Comment

          Working...