neww help with MSSQL select statement

Posted by gio_333m on Stack Overflow See other posts from Stack Overflow or by gio_333m
Published on 2010-06-05T21:10:20Z Indexed on 2010/06/05 21:12 UTC
Read the original article Hit count: 114

Filed under:
|

Hello,
I need help with select statement in MSSQL.

My table looks like this:
Id (int)
QuestionId (int)
GenreId (int)

I want to select random N rows from this table so that maximum number of same GenreId in the result set is less than X for all GenreId-s except one. For that one GenreId, I need row count with that GenreId to be equal to Y.

Thanks in advance

© Stack Overflow or respective owner

Related posts about sql

Related posts about select