Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SQL – After group by filtering down to rows where column value = certain string

Not sure why this isn’t working.

When I run the query without HAVING segment ilike 'Enterprise' I get results (see screenshot) but when I add it back in the query returns nothing despite clearly containing instances where segment = ‘Enterprise’. I can’t find any instances online where having is used to filter for strings so I’m thinking this just isn’t possible. Could someone confirm if this is the case and if there is an alternative method if so? Thanks.

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can’t use HAVING to filter for strings, you can only use it to filter for numeric values. To filter for strings, you’ll need to use the WHERE clause.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading