Click here to Skip to main content
15,913,709 members
Home / Discussions / Database
   

Database

 
QuestionGroup by record count, and get the first of every group, eg... Pin
followait13-Nov-07 4:07
followait13-Nov-07 4:07 
AnswerRe: Group by record count, and get the first of every group, eg... Pin
Adeel Chaudhry13-Nov-07 19:13
Adeel Chaudhry13-Nov-07 19:13 
GeneralRe: Group by record count, and get the first of every group, eg... Pin
followait13-Nov-07 19:40
followait13-Nov-07 19:40 
GeneralRe: Group by record count, and get the first of every group, eg... Pin
Adeel Chaudhry13-Nov-07 19:47
Adeel Chaudhry13-Nov-07 19:47 
GeneralRe: Group by record count, and get the first of every group, eg... Pin
followait13-Nov-07 20:16
followait13-Nov-07 20:16 
GeneralRe: Group by record count, and get the first of every group, eg... Pin
Adeel Chaudhry13-Nov-07 20:22
Adeel Chaudhry13-Nov-07 20:22 
GeneralRe: Group by record count, and get the first of every group, eg... [modified] Pin
followait13-Nov-07 21:01
followait13-Nov-07 21:01 
GeneralRe: Group by record count, and get the first of every group, eg... Pin
Adeel Chaudhry13-Nov-07 22:38
Adeel Chaudhry13-Nov-07 22:38 
Hi,

I haven't tried it, just a thought, try with the preprocessing of the data, like write a procedure/routine for knowing groups, and keep a count of each groups rows, and pick by using that count.

Second idea is, to try with a Top function, in multiple sub queries, or via partitioning.

This is tricky, because you are trying to do multi-dimentional sort of activity, on a DBMS which is not much familiar to it!

Even in MS SQL 2005, it is bit difficult, but do-able, using the ranking function with top function.

Hope this is of some help.

Regards,

Adeel

Do rate the reply, if it helps or even if it doesnot, because it helps the members to know, what solved the issue. Thanks.

GeneralRe: Group by record count, and get the first of every group, eg... Pin
followait14-Nov-07 2:11
followait14-Nov-07 2:11 
Questionhelp with these query Pin
Ahmad Adnan13-Nov-07 2:52
Ahmad Adnan13-Nov-07 2:52 
AnswerRe: help with these query Pin
Adeel Chaudhry13-Nov-07 19:11
Adeel Chaudhry13-Nov-07 19:11 
QuestionSimple Stuff...but I don't know it. Pin
imnotso#13-Nov-07 2:06
imnotso#13-Nov-07 2:06 
AnswerRe: Simple Stuff...but I don't know it. Pin
Marek Grzenkowicz13-Nov-07 2:23
Marek Grzenkowicz13-Nov-07 2:23 
GeneralRe: Simple Stuff...but I don't know it. Pin
imnotso#13-Nov-07 2:25
imnotso#13-Nov-07 2:25 
GeneralRe: Simple Stuff...but I don't know it. Pin
Marek Grzenkowicz13-Nov-07 3:08
Marek Grzenkowicz13-Nov-07 3:08 
AnswerRe: Simple Stuff...but I don't know it. Pin
John-ph13-Nov-07 2:57
John-ph13-Nov-07 2:57 
GeneralRe: Simple Stuff...but I don't know it. Pin
Colin Angus Mackay13-Nov-07 3:08
Colin Angus Mackay13-Nov-07 3:08 
GeneralRe: Simple Stuff...but I don't know it. Pin
imnotso#13-Nov-07 3:13
imnotso#13-Nov-07 3:13 
GeneralRe: Simple Stuff...but I don't know it. Pin
John-ph13-Nov-07 3:36
John-ph13-Nov-07 3:36 
AnswerRe: Simple Stuff...but I don't know it. Pin
Shpendh13-Nov-07 4:18
Shpendh13-Nov-07 4:18 
GeneralRe: Simple Stuff...but I don't know it. Pin
imnotso#13-Nov-07 4:22
imnotso#13-Nov-07 4:22 
GeneralRe: Simple Stuff...but I don't know it. Pin
pmarfleet13-Nov-07 9:13
pmarfleet13-Nov-07 9:13 
QuestionBinding Data Dynamically to a label Pin
sindhutiwari13-Nov-07 1:24
sindhutiwari13-Nov-07 1:24 
QuestionNeed to Add a column to the existing table Pin
SelvaKr12-Nov-07 23:48
SelvaKr12-Nov-07 23:48 
AnswerRe: Need to Add a column to the existing table [modified] Pin
joemonvarghese12-Nov-07 23:58
joemonvarghese12-Nov-07 23:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.