[Oracle] some SQL keywords

1. distinct

DISTINCT keyword is used to return only difference values;

Can only be used in select;

Either on a, can also be used for multiple columns;

NULL is not distinct for filtering, i.e., the result returned is NULL values;

With ALL can not be used (select all order_name from prd_order);

Can be used with * it indicates that all of the columns;

select distinct order_name from prd_order;
select distinct order_num, order_name from prd_order;
select distinct * from prd_order;

 

Guess you like

Origin www.cnblogs.com/myitnews/p/11834134.html