combine query

  • Use OR/IN in the your WHERE clause.

    SELECT itemno,item code,closedate
    FROM item a INNER JOIN itemcode bFROM item a INNER JOIN itemcode b
    ON a.itemno= b.itemnoON a.itemno= b.itemno
    WHERE  a.itemdesc IN *('approve', 'in progress', 'received');WHERE  a.itemdesc IN *('approve', 'in progress', 'received');

  • I want something liekt his

    SELECT itemno,item code,closedate as new_date(in progress),close_date for open_date(approve)
    FROM item a INNER JOIN itemcode bFROM item a INNER JOIN itemcode b
    ON a.itemno= b.itemnoON a.itemno= b.itemno
    WHERE a.itemdesc IN *('approve', 'in progress', 'received');WHERE a.itemdesc IN *('approve', 'in progress', 'received');

     

  • Why not make things easy for everyone and tell us all what your expected output is given the data you have already provided?

  • maybe something like:
    SELECT a.itemno, b.itemcode,
        CASE a.itemdesc
        WHEN 'aprove' THEN a.closedate
        WHEN 'inprogress' THEN a.opendate
        WHEN 'reject' THEN a.eventdate
        END AS evemtdate
      FROM item a
      INNER JOIN itemcode b ON a.itemno = b.itemno
      WHERE a.itemdesc IN ('aprove', 'inprogress', 'reject')

Viewing 4 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply