SELECT UNIQUE and SELECT DISTINCT
Hello , i am practicing Oracle 9i, Can Anybody tell me what is the difference between the UNIQUE and DISTINCT keywords? Because Whenever i Excuted this two Queries SELECT UNIQUE() FROM TABLE and this SELECT DISTINCT() FROM TABLE , I always Get the Same Result , I am not able to identidy the main difference between both the Queries thanks in advance
Re: SELECT UNIQUE and SELECT DISTINCT
DISTINCT and UNIQUE are synonymous , Unique is a keyword used in the Create Table() directive to denote that a field will contain unique data, For example: SELECT DISTINCT object_type FROM user_objects;is the same as: SELECT UNIQUE object_type FROM user_objects
Re: SELECT UNIQUE and SELECT DISTINCT
Hello , There are actually not Much Difference between the two Keyword the UNIQUE Can be Used For only once for a column in a table and the DISTINCT keyword can be Used in select query to retrive distinct data from table
Re: SELECT UNIQUE and SELECT DISTINCT
sometimes you will want to list only the different (distinct) values in a table. The DISTINCT keyword can be used to return only distinct (different) values Specify DISTINCT or UNIQUE if you want Oracle to return only one copy of each set of duplicate rows selected (these two keywords are synonymous). Duplicate rows are those with matching values for each expression in the select list.Restrictions on DISTINCT and UNIQUE Queries