I have the below query, everytime i change it i need to change the stockclientid. I would like it where i only have one where statement to apply to all the sub queries.
Is there also a way to apply the same code to return multiple rows? I would like to have the results display for all stockclientIDs rather than just 1.
Select
(Select distinct SName FROM classifiedadmin.readOnly_CoreData) as SupplierName,
(SELECT COUNT(*) FROM classifiedadmin.readOnly_CoreData where Successful= 1 and StockClientID=3) as TotalLive,
(Select count(*) FROM classifiedadmin.readOnly_CoreData where length(DetailDesc) > 200 and StockClientID= 3) as DescriptionOver200,
(select count(*) from classifiedadmin.readOnly_CoreData where busruleViolated=1 and StockClientID = 3) as BusinessRuleViolated,
(Select count(*) FROM classifiedadmin.readOnly_CoreData where StockClientID = 3
and Successful=0
and busruleviolated=0
and Edition not like '%auto%'
and Edition not like '%shift%'
and Edition not like '%tronic%'
and Edition not like '%van%'
and Edition not like '%DSG%') as UnadvertisedManual;