Rincewind Posted February 28, 2011 Report Posted February 28, 2011 Tabula: c1 c2 100 j 90 i 80 h 70 g 60 f 50 e 40 d 30 c 20 b 10 a Vai var kaut kā selektēt top 5 no c1 un rezultātu sakārtot pēc c2 bez ieliktajiem query (SELECT * FROM (SELECT...))? Vajadzīgais rezultāts: f 60 g 70 h 80 i 90 j 100 Quote
marcis Posted February 28, 2011 Report Posted February 28, 2011 Kaut kā šitā varētu būt. (SELECT `c1`, `c2` FROM `tabula` ORDER BY `c1` DESC LIMIT 5) ORDER BY `c1` ASC Quote
m8t Posted February 28, 2011 Report Posted February 28, 2011 SELECT * FROM ... ORDER BY c1 DESC LIMIT 5 ?? pag, c1 un c2 ir tabulas vai rindas? Quote
Rincewind Posted February 28, 2011 Author Report Posted February 28, 2011 Kaut kā šitā varētu būt. (SELECT `c1`, `c2` FROM `tabula` ORDER BY `c1` DESC LIMIT 5) ORDER BY `c1` ASC O! Paldies. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.