Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need Help,\.
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 07/28/2013 :  09:58:49  Show Profile  Reply with Quote
I have created groups of photos, i want to select one photo from each group, what willbe the query? please help me , its urgent.


Premature Yak Congratulator

22864 Posts

Posted - 07/28/2013 :  11:06:29  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
Refer this post


Failing to plan is Planning to fail
Go to Top of Page

Very Important crosS Applying yaK Herder

52326 Posts

Posted - 07/28/2013 :  11:35:52  Show Profile  Reply with Quote
use logic based on ROW_NUMBER as in the link. The partition by should contain your grouped columns and order by should include columns based on which you need to do the ordering. if random order is enough, use NEWID() function.

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000