How will you select unique values from a list of records?
Answers were Sorted based on User's Feedback
Answer / os reddy
select distinct * from emp;
OR
select unique * from emp;
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / eshwer
by using min(rowid) or max(rowid). its like deleting duplicate values.
select columns from emp where rowid not in[in] (select maxrow(id) from emp group by columns);
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the usage of nvl function?
HP Interview -2016 Unix 1) grep command in unix 2) what is set command
How do I view a view in sql?
What is difference between a Cursor declared in a procedure and Cursor declared in a package specification ?
what is a foreign key ? : Sql dba
What is the purpose of using pl/sql?
What is foreign key in sql with example?
i hv 30 rows with date.ex:1month hav 4 weeks i want 1st day of the every week.write the qry for that.example jan has 4 weeks i need 1st dd for evry wk
What is the difference between the repeatable read and serializable isolation levels? : Transact sql
write a query to remove null following table are id name 101 dinesh null jyothi null bharathi 102 suresh null shilpha 103 prakesh null suma i want the output format like id name 101 dinesh 102 suresh 103 prakesh
Does google use sql?
Which sql statement is used to return only different values?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)