I am trying to construct a query where I check the number of rows returned from a sql select. For example, I want to check that if the number of rows returned from a query are greater than 3, then do something else do nothing
if @@rowcount(select clientId from Clients group by clientId) > 3
PRINT 'WARNING'
Any ideas appreciated