Results 1 to 5 of 5

Thread: What is the difference between Distinct and DistinctRow?

  1. #1
    Join Date
    Nov 2009
    Posts
    351

    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.

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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

  4. #4
    Join Date
    Nov 2009
    Posts
    351

    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.

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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.

Similar Threads

  1. Replies: 5
    Last Post: 08-04-2011, 10:20 AM
  2. Select unique values without using distinct
    By Maya Angelou in forum Software Development
    Replies: 6
    Last Post: 17-05-2010, 10:26 AM
  3. SQL UNIQUE and DISTINCT
    By Taarank in forum Software Development
    Replies: 5
    Last Post: 10-05-2010, 10:40 PM
  4. How to use DISTINCT in SQL
    By DotNetUser in forum Software Development
    Replies: 2
    Last Post: 07-09-2009, 11:33 PM
  5. Distinct OR Group By
    By sidkid in forum Windows Software
    Replies: 3
    Last Post: 03-09-2009, 08:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,586,535.72226 seconds with 17 queries