Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 04-02-2010
Member
 
Join Date: Nov 2009
Posts: 348
What is the difference between Distinct and DistinctRow?

I am new to this database field of queries and started learning how to make the queries for retrieving the data from the table. I have also learned that there many way for getting the same kind of data. Now I having the problem with the types of queries that are
Select Distinct
And the other one is
Select Distinct Row
These two thing looks similar to me but there might be a difference in retrieving the data. If there is a difference between the two then can anybody tell me what is the actual difference between the two. I will be waiting for the related replies.
Reply With Quote
  #2  
Old 04-02-2010
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Details of Distinct query

See I can explain you the meaning of the distinct queries. Distinct queries omits the fields that comprise of the duplication fields in the fields data which are selected by the user. If the user want the result of SELECT query to have the distinct field or the not repeated fields data then the user can use the select query with distinct option. Means if the user having the request for finding the result with the not repeated result then this requirement can be fulfilled with the help of this SELECT DISTINCT query.
Reply With Quote
  #3  
Old 04-02-2010
Member
 
Join Date: May 2008
Posts: 2,008
Re: What is the difference between Distinct and DistinctRow?

DISTINCTROW option in the SELECT query is used when the search is based on the entire records not for the specific fields. Normally this is used by the user for creating joins. For example you can consider one example if you want to join two table like customer and order table. Now in the customer table the name of customer comes only once but in the order table the name of customer is repeated more than once because of the simple reason that one customer can place more than one order. In that case for joining these two table and finding the distinct record used the DISTINCTROW query
Reply With Quote
  #4  
Old 04-02-2010
Member
 
Join Date: Nov 2009
Posts: 348
Re: What is the difference between Distinct and DistinctRow?

Thank you for the replies you have given I have got a little bit idea that there is difference between the two DISTICT query and DISTINCTROW query. Normally the DISTINCT query filter the data on the bases of the fields. Means if there is a repetition in the field then it will filter that record and the DISTICTROW query filter the data on the bases of entire record. But it will better if you can explain me these things on the bases of example.
Reply With Quote
  #5  
Old 04-02-2010
Member
 
Join Date: May 2008
Posts: 2,293
Re: Difference between Distinct and DistinctRow

I will try to explain the difference between DISTINCT and DISTINCTROW query on the bases of example
SELECT DISTINCT
FirstName
FROM EmployeeRecord;
The above query will result in the data which is filtered on the bases of field of FirstName in the EmployeeRecord table.

SELECT DISTINCTROW IndustryName
FROM clients INNER JOIN Orders
ON Clients.ClientsID = Orders.ClientsID
ORDER BY IndustryName;
In the above query the result is filtered on the bases of the entire record not only on bases of field. If the entire record is repeated than the record is filtered out.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the difference between Distinct and DistinctRow?"
Thread Thread Starter Forum Replies Last Post
NFS Shift 2 Unleashed: Distinct delay when the wheel is physically turned Raja Ram Video Games 5 08-04-2011 10:20 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
How to use DISTINCT in SQL DotNetUser Software Development 2 07-09-2009 11:33 PM
Distinct OR Group By sidkid Windows Software 3 03-09-2009 08:36 PM


All times are GMT +5.5. The time now is 10:53 AM.