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

how to display specific rows in sql

I have this rows in my table

Name    Grade        Comply
Alpha   2.5          NULL
Beta    Incomplete   NULL
Charlie Incomplete   3.0
Delta   1.5          NULL

I want to display only those with grades ex.(2.5,1.5) and grades with Incomplete but have value in comply column like charlie.

Name     Grade       Comply
Alpha    2.5         NULL
Charlie  Incomplete  3.0
Delta    1.5         NULL

Hope someone helps

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 :

SELECT name, grade, comply
FROM table <tabname>
WHERE grade in ("2.5","1.5") 
OR (grade="Incomplete" and comply is not null);
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