Results 1 to 2 of 2

Thread: doing a DISTINCT for one column only, possible?

  1. #1
    Lou Thompson Guest

    doing a DISTINCT for one column only, possible?

    How can I do a DISTINCT on one column only, within a 4 level JOIN ?

    Here's the example;

    One of the tables I'm joining is called 'seasons' with 3 columns: 'season' 'start_date' 'end_date'.

    In the main table there is a column 'season' where the value is either 'basic', 'shoulder' or 'peak'.

    In the 'seasons' table, the 'season' column is also one of the 3 mentioned season types. However, there is usually more than one line for the same season but with different date periods.

    Now when I use this query that I created with Access, it retrieves the same record from the 'main' table multiple times! I now figured out it's because it's counting how many season periods there are, even though they're all with the same season type...

  2. #2
    Sumit Guest

    doing a DISTINCT for one column only, possible? (reply)


    Instead of directly using Seasons table in the Join, create a Query first to select distinct seasons from the Season table and then use this Query in your main query join.

    ------------
    Lou Thompson at 5/12/01 10:46:41 PM

    How can I do a DISTINCT on one column only, within a 4 level JOIN ?

    Here's the example;

    One of the tables I'm joining is called 'seasons' with 3 columns: 'season' 'start_date' 'end_date'.

    In the main table there is a column 'season' where the value is either 'basic', 'shoulder' or 'peak'.

    In the 'seasons' table, the 'season' column is also one of the 3 mentioned season types. However, there is usually more than one line for the same season but with different date periods.

    Now when I use this query that I created with Access, it retrieves the same record from the 'main' table multiple times! I now figured out it's because it's counting how many season periods there are, even though they're all with the same season type...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •