Results 1 to 5 of 5

Thread: Select Unique Values (Selecting The Most Recent Record Based On Date)

  1. #1
    Join Date
    Dec 2009
    Posts
    62

    Select Unique Values (Selecting The Most Recent Record Based On Date)

    Hello, I want to select the Unique values from the tables of the database which are based on the date. Consider, the following table for that:
    • name - created
    • First - 6/6/09
    • Second - 6/9/04
    • Third - 9/9/04
    • Fourth - 8/8/04
    • Fifth - 9/9/09

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Select Unique Values (Selecting The Most Recent Record Based On Date)

    I have tried this before and you can simply make use of the below query and the get the Unique values from the table. So, just make use of that.
    Code:
    select * from Techarena;
    This will simply select all form the Techarena table.

    Code:
    select distinct Category from Techarena;
    This will simply select the Unique Category from the Techarena table.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Select Unique Values (Selecting The Most Recent Record Based On Date)

    In a table, several columns may include similar records. It is not a trouble; however, occasionally you will want to listing only the different values in a table. The DISTINCT keyword can be used to provide distinct values.
    SQL SELECT DISTINCT Syntax
    Code:
    SELECT DISTINCT column_name(s)
    FROM table_name

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Select Unique Values (Selecting The Most Recent Record Based On Date)

    Follow the Steps below for solution :
    • First you need to start the SQL view window.
    • Then you need to Type query as "SELECT DISTINCT" and column name for which you want the values.
      eg.
      Code:
      SELECT DISTINCT ID
    • Now you need to type "FROM" and then you must need to give the table name.
      Code:
      FROM Student
    • Now you can run the query.

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

    Re: Select Unique Values (Selecting The Most Recent Record Based On Date)

    It is just required to make use of the Distinct keyword if you want to make get the Unique values from the table. There is not any other solution or query for that. Just use that and get solved for your problem. I have used it most of the time and it works perfectly. You will able to get the Unique values in the Ouutput if you make use of this keyword. You have to provide the column name and table name also.

Similar Threads

  1. Select unique values using xsl
    By Elizabeth Allen in forum Software Development
    Replies: 6
    Last Post: 17-05-2010, 10:27 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. Select unique columns from a record set
    By Madhuchhanda in forum Software Development
    Replies: 6
    Last Post: 12-05-2010, 11:31 PM
  4. How to get unique values with respective count from a list
    By hounds in forum Software Development
    Replies: 4
    Last Post: 06-03-2010, 09:54 PM
  5. SELECT UNIQUE and SELECT DISTINCT
    By TAARIQ in forum Software Development
    Replies: 3
    Last Post: 03-06-2009, 10:00 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,267,718.33475 seconds with 17 queries