|
| ||||||||||
| Tags: distinct, sql |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to use DISTINCT in SQL
Code: SELECT DISTINCT(empId) FROM (SELECT empId FROM Employee WHERE Name LIKE 'R%') |
|
#2
| ||||
| ||||
| Re: How to use DISTINCT in SQL
The SQL DISTINCT command retrieves only unique data entries depending on the column list you have specified after it. The SELECT statement provides us all the information from column(s) on a table. Situations may arise where you will be find a lot of duplicates in the result that you got. To remove all this duplicates, we need to use DISTINCT after SELECT keyword. The syntax is as follows: Quote:
__________________ Grand Theft Auto 4 PC Video Game |
|
#3
| |||
| |||
| Re: How to use DISTINCT in SQL
You can even do the same thing as in here: Code: SELECT DISTINCT empId FROM Employee WHERE Name LIKE 'R%' |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to use DISTINCT in SQL" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot highlight distinct cells in different rows and column in a Pivot table ? | Grayson | Windows Software | 3 | 27-11-2010 04:25 AM |
| Select unique values without using distinct | Maya Angelou | Software Development | 6 | 17-05-2010 10:26 AM |
| SQL UNIQUE and DISTINCT | Taarank | Software Development | 5 | 10-05-2010 10:40 PM |
| What is the difference between Distinct and DistinctRow? | Orion lella | Software Development | 4 | 04-02-2010 12:29 AM |
| Distinct OR Group By | sidkid | Windows Software | 3 | 03-09-2009 08:36 PM |