Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2001-04-24 : 13:11:58
|
| Hey all,Back with a confusing query that I have never got to work, (asked back a few weeks, but dead ends)Basically, I have tried a ton of stuff, but i am confused, more so than when i started which means its almost miller time.I need to grab one record for each residentid in the table, (can be many) ordered by level, (can be multiple records for 1 residentid with same level)in end, all I want is the literal,count(residentid)grouped by literal (shows new criminals for some time frame, by literal)i have a table of OFfensehas identity of offenseid(id)residentid is PK of diff't table (foreign key)literal is an id of another tablelevel is a column that specifies the orderID | residentid | literal | levelso if residenti "85" has 3 records99|85|98980|F70|85|43434|G88|85|35353|FI only want one of the "F" records to be counted.Any ideas at all, I have tried just about everything I know, and I am lost.Thanks for the help.Software Composer |
|
|
|
|
|