Skip to content
Advertisement

Creating required script

My question is about select statement. I have a table called test1 and the values in it. Here my script for creating the table, and inserting values:

My question is how can I select the Ids from test1 table that the pc column contains only 0 or 91 and pe column contains only 20, 201, 202, 900, 901 or 902. So Ids like 13.

Advertisement

Answer

Just check that count of satisfying rows is equal to count(*):

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement