Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

asked on

Select and return results ONLY if more than one result

I have a recordset that may or may not have records. I want to have a select statement that returns the records only if there is more than one, if there is only one then return nothing.

Select * from recordset (only if more than 1 record)
Avatar of Pratima
Pratima
Flag of India image

YOu need to use Group by and all column names instade of *


Try like this , REplace use column names instade of col1 , col2

select col1, col2 , col2 , col4 from recordset
group by col1, col2 , col2 , col4
having count(*) > 1
ASKER CERTIFIED SOLUTION
Avatar of Rick_Rickards
Rick_Rickards
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial