Guest User

Untitled

a guest
Jan 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. Medication-MedicationID, BrandName, GenericName
  2.  
  3. select max(GenericCount)
  4. from
  5. (
  6. select count(*) GenericCount, GenericName
  7. from yourtable
  8. group by GenericName
  9. ) x
  10.  
  11. select count(*) GenericCount, GenericName
  12. from yourtable
  13. group by GenericName
  14.  
  15. SELECT MAX(COUNT(GenericName)), GenericName FROM MedicationTable GROUP BY GenericName
Add Comment
Please, Sign In to add comment