Category: Oracle

Oracle EXISTS

The Oracle EXISTS condition tests for existence of rows in a subquery. Oracle EXISTS example Select * From books Where EXISTS (Select * From sales s Where b.book_id = s.book_id); Oracle NOT EXISTS example Select * From invoices i Where NOT...

Oracle DISTINCT

The Oracle DISTINCT statement uses to return only unique values. Oracle DISTINCT example Select Distinct user_id, name From users_log; Select Distinct b.author, b.book_name From books b Where b.author = 'SMITH' And book_name Like '%ORACLE%' Select avg(Distinct price) From books Where book_name...

Oracle Between

The Oracle Between determines whether the value of one expression is in an interval defined by two other expressions. Oracle Between example Select * From users_log u Where u.log_date Between '01-OCT-2011' And '31-OCT-2011'; Select * From books b Where b.book_id Not...

Oracle All Operator

Oracle ALL operator compares a value with every value in a list or returned by a query. Oracle ALL example Select * From sales s Where amount > ALL (4000, 5000, 6000);...

Oracle Alias Column

The Oracle Alias Column is used to temporarily rename a column. Oracle Alias Column example Select first_name ||' '|| last_name AS full_name, code AS id From customers; Select o1.offer_id, o1.amount, ( Select count(*) From offers o2 Where o1.amount = o2.amount )...