How to select whole column from SQL table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ramanan ram
    New Member
    • Feb 2012
    • 26

    How to select whole column from SQL table

    SELECT vuid
    FROM tbl_poms
    MINUS
    SELECT bookingrefno
    FROM etrans3103.ri_p rq_job_union_vi ew_bd1
    MINUS
    SELECT vuid
    FROM tbl_dsrpoms;
    this query executing correct answer ok ,i am selecting vuid
    column only from tbl_poms but
    i need whole column from the tbl_poms table
    if i am select * from tbl_poms display error
    have any another way please give the solution
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Alias the whole query and join the results with the table you want to select from with something like
    Code:
    with result as (SELECT vuid
    FROM tbl_poms
    MINUS
    SELECT bookingrefno
    FROM etrans3103.ri_prq_job_union_view_bd1
    MINUS
    SELECT vuid
    FROM tbl_dsrpoms) 
    select tbl.* from tbl_poms tbl, result r where r.vuid = tbl.vuid
    ;

    Comment

    Working...