List:General Discussion« Previous MessageNext Message »
From:bruce Date:January 4 2007 4:46pm
Subject:group by/select issue..
View as plain text  
hi...

i have the following test tbl

dog
  name	char
  status	int
  id		int

test data
  dog
   name	status	id
    tom	 1		1
    tom      2          2
    sue      1          3
    tom      3          4
    sue      2          5
    bob      1          6

i'm trying to figure out how to create a select query that groups
the tbl around 'name' such that if i want all names that do not
have a status=3, i'd get a single row for 'sue' and 'bob'

i'd also like to be able to get a single row for 'bob' if i wanted the
'name' (group) that do not have a status=2.

i'm not sure how to craft the select using the group by/distinct, and i
couldn't find examples via google to solve this...

once i get my hands around this, i can apply it to a test tbl of 2000-3000
rows...

thanks

bruce

Thread
group by/select issue..bruce4 Jan
  • Re: group by/select issue..Chris White4 Jan
    • RE: group by/select issue..bruce4 Jan
      • Re: group by/select issue..Peter Bradley4 Jan
        • RE: group by/select issue..bruce4 Jan
          • RE: group by/select issue..ddevaudreuil4 Jan
            • RE: group by/select issue..bruce4 Jan
              • RE: group by/select issue..ddevaudreuil4 Jan