Home Forums SQL Server 2005 T-SQL (SS2K5) displaying records only if both the values of a field are avaliable RE: displaying records only if both the values of a field are avaliable

  • ssurekha2000 (8/3/2013)


    sample data attached

    i hope this is the proper for you to proceed

    select from table1

    where exists (select 1 from table1 where col1 = 'd') and exists (select 1 from table1 where col1 = 'i')

    union all

    select from table2

    where exists (select 1 from table2 where col1 = 'd') and exists (select 1 from table2 where col1 = 'i')

    etc

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.