+ Reply to Thread
Results 1 to 4 of 4

Thread: Need SQL select help please...

  1. #1
    DougCMH Guest

    Default Need SQL select help please...

    Try this. This worked for me.
    Code

  2. #2
    Guest.Visitor Guest

    Default Need SQL select help please...

    Try this, SELECT FLD1, FLD2, FLD3, FLD4, COUNT(*) AS COUNT FROM FILE1 GROUP BY FLD1, FLD2, FLD3, FLD4 ORDER BY FLD1, FLD2, FLD3, FLD4

  3. #3
    danbo@danbo.com Guest

    Default Need SQL select help please...

    Lack of enough experience is frustrating trying to figure this one out. I have a table with 4 values as such: REC1 12345 ABC 45678 90123 REC2 12345 ABC 45678 90123 REC3 12345 DEF 45678 90123 REC4 23456 ABC 12345 67890 REC5 23456 ABC 12345 67890 Basically, I need to group the records by the first two values, perhaps using distinct. Yet, I don't want a single record without also having a count of the records where the first two values match. Basically, the result would be something like: REC1 12345 ABC 45678 90123 2 REC2 12345 DEF 45678 90123 1 REC3 23456 ABC 12345 67890 2 I've tried a number of things to ATTEMPT to count them all up with a select statement (need to do some additional processing anyway), but to no avail. I just don't have the knowledge yet on how to not only do a count, but also distinct while giving me all the columns I still need for the additional processing. Any suggestions?

  4. #4
    danbo@danbo.com Guest

    Default Need SQL select help please...

    Thanks to both of you for the assist on this. Gonna have to write that one down for future reference. The quick response was greatly appreciated.

+ Reply to Thread

Similar Threads

  1. Select into
    By Guest.Visitor in forum SQL
    Replies: 1
    Last Post: 05-18-2005, 10:48 AM
  2. Select 0 record if exists, else select max value
    By David Abramowitz in forum SQL
    Replies: 2
    Last Post: 04-09-2002, 05:02 AM
  3. From SELECT to an
    By Guest.Visitor in forum Programming
    Replies: 1
    Last Post: 03-03-2001, 06:50 AM
  4. Select top 100
    By Guest.Visitor in forum Programming
    Replies: 0
    Last Post: 01-01-1995, 02:00 AM

Posting Permissions

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