i have a table with 5 fields
field1 will have values as 'd' and 'i'
if the field1 of table has both the values then only the data shld e displayed
but if the field1 has only value 'd' then no data shld be displayed
i have tried select * from #temp1 where col1='d' and col1 ='i'
but nothing gets displayed
Usually I would ask for DDL, sample data etc. - as per the link in my signature. But it sounds like you want something like this:
If exists (select 1 from table where col1 = 'd') and exists (select 1 from table where col1 = 'i')
select * from table
Help us to help you. For better, quicker and more-focused answers to your questions, consider following the advice in this
If the answer to your question can be found with a brief Google search, please perform the search yourself, rather than expecting one of the SSC members to do it for you.
Please surround any code or links you post with the appropriate IFCode formatting tags. It helps readability a lot.