tiy Posted March 3, 2007 Report Share Posted March 3, 2007 Ir tabula ieraksti ar ierakstiem, vai var kaut ka ar limit un offsetu piedabut izvadit pedejos 100 ierakstus, bet nelietojot order by col desc limit 100, stradas tikai sanaks ta 100, 99 ,98 utt. Tas ir nezimantot php tikai ar mysql puse? 1 ... 2 ... 3 ... 99... 100... Link to comment Share on other sites More sharing options...
Grey_Wolf Posted March 3, 2007 Report Share Posted March 3, 2007 (edited) Kaa tas ir neizmantojot LIMIT un lai straadaatu MySql pusee? Tad tikai ar burvju vardiem! ;) Bet ja nopietni Kur probleema? Tu tachu vari kartot kaa vien veelies ;) ORDER BY col DESC LIMIT 100 dilstoshaa ORDER BY col ASC LIMIT 100 Augoshaa Edited March 3, 2007 by Grey_Wolf Link to comment Share on other sites More sharing options...
andrisp Posted March 3, 2007 Report Share Posted March 3, 2007 Doma laikam tur, ka vajag atlasīt pēdējos 100 ierakstus, bet tā lai rezultsetā tie tiktu atgriezti sākot ar vecāko. Šis strādās, bet neatgriezīs vajadzīgā secībā: SELECT * FROM table ORDER BY col DESC LIMIT 0, 100 Bet var darīt kaut kā apt. šadi: SELECT COUNT(*) FROM table; Un pēc tam: SELECT * FROM table ORDER BY col ASC LIMIT ieprieksheja_kverija_rezultats - 100, 100 Link to comment Share on other sites More sharing options...
Recommended Posts