SQL - How to check for multiple values of one column while only returning one row?

katheydbosmad

New Member
Sorry if the question was worded weird.I'm writing a report and I have a table that has fields like this....\[code\] applicationID statusid statuscreationdate 123 1 3-18-2013 123 2 3-27-2013 124 1 3-29-2013 125 1 4-1-2013 125 2 4-3-2013\[/code\]And I only want to return rows with a statusid of 1 BUT I also want to check if a statusid of 2 exists for each applicationid. So the desired query on the above table would produce:\[code\] 123 3-18-2013 125 4-1-2013\[/code\]Any help would be appreciated. If more information is needed, let me know. I wanted to keep this as short and simple as possible while including the necessary amount of information.Thanks for your time.Edit: corrected the desired results part
 
Top