sandrulis Posted February 9, 2011 Report Share Posted February 9, 2011 (edited) tabula izskatās pamēram šādi: | id | name | sticky | | 1 | nosaukums | 0 | | 2 | nosaukums | 1 | | 3 | nosakumus | 0 | | 4 | nosakumus | 0 | | 5 | nosakumus | 0 | "SELECT * FROM tabulas_nosaukums ORDER BY id DESC" Viss ir normāli, bet kā lai izveidot tā , lai 'sticky ' ieraksts rādītos kā pirmais un tad atkal pēc 'id' DESC? P.S. visiemabūt vienā 'SELECT ', jo visi ieraksti tiks kārtoti pēc tam pa lapām Edited February 9, 2011 by sandrulis Quote Link to comment Share on other sites More sharing options...
nikidijs Posted February 9, 2011 Report Share Posted February 9, 2011 "SELECT * FROM tabulas_nosaukums ORDER BY sticky, id DESC" Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted February 9, 2011 Report Share Posted February 9, 2011 SELECT * FROM tabulas_nosaukums ORDER BY sticky DESC, id DESC Quote Link to comment Share on other sites More sharing options...
sandrulis Posted February 9, 2011 Author Report Share Posted February 9, 2011 Paldies xPtv45z, un nikidijs, bet nikidijs ar Tavu variantu man kkas isti nestrādāja :( Quote Link to comment Share on other sites More sharing options...
nikidijs Posted February 9, 2011 Report Share Posted February 9, 2011 ...bet nikidijs ar Tavu variantu man kkas isti nestrādāja :( Jup. Pēc mana varianta, tev tas sticky būtu beigās nevis sākumā. Pēc xPtv45z - otrādi. Vnk uzrādiju kā apvienot vairākus ORDERUS :) Quote Link to comment Share on other sites More sharing options...
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.