The Oracle GROUP BY clause groups a select result into subsets that have matching values for one or more columns. Oracle GROUP BY example Select id, product, avg(amount), sum(amount), max(amount), count(*) From sales Group By id, product Order By id ;...
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...
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...
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 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);...