Count() with where clause
SQL> CREATE TABLE customers
2 (
3 id NUMBER,
4 state_province VARCHAR2(40),
5 country_id CHAR(2) CONSTRAINT customer_country_id_nn NOT NULL,
6 phone_number VARCHAR2(25),
7 income_level VARCHAR2(30),
8 credit_limit NUMBER,
9 email VARCHAR2(30)
10 );
Table created.
SQL>
SQL>
SQL> select count(*)
2 from customers
3 where state_province = 'Delhi';
COUNT(*)
----------
0
1 row selected.
SQL>
SQL> delete from customers
2 where state_province = 'Delhi';
0 rows deleted.
SQL>
SQL> drop table customers;
Table dropped.
Related examples in the same category