NBS Posted October 22, 2008 Report Share Posted October 22, 2008 Sveiki, vēlējos uzzināt, kā varētu realizēt VBScript'ā, rezultāta sadalīšanos pa lapām: Ar SELECT palīdzību iegūstu rezultātu, kas satur 14 000 rindiņas(vienā rindā 8 parametri) un 'nedaudz' piebremzē, izvadot browser'ī. Kā es varētu sadalīt šo rezultātu teiksim pa 100 ierakstiem/1 lapā un pēc tam spiest vienkārīši uz priekšu un ja vajag atpakaļ pa tiem pašiem 100 ierakstiem ? Paldies, savlaicīgi. Link to comment Share on other sites More sharing options...
andrisp Posted October 22, 2008 Report Share Posted October 22, 2008 Kas tev bija par DB ? Link to comment Share on other sites More sharing options...
NBS Posted October 23, 2008 Author Report Share Posted October 23, 2008 MS SQL 2005 Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2008 Report Share Posted October 23, 2008 http://www.google.com/search?hl=en&q=mssql+limit Link to comment Share on other sites More sharing options...
NBS Posted October 23, 2008 Author Report Share Posted October 23, 2008 Hmm, izpratu loģiku varētu paraugu vienu uzmest man, lūdzu, jo: SELECT billsid, financ_ID, dat_no, dat_lidz, transfer_date, uid, uptime FROM bills WHERE ind = 11 LIMIT 50, 1 Neizdodas... Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2008 Report Share Posted October 23, 2008 Tu jau nemaz nepapētīji to gūgles rezultsetu. MSSQL nav tāds keywords LIMIT. Link to comment Share on other sites More sharing options...
NBS Posted October 23, 2008 Author Report Share Posted October 23, 2008 Hmm, tas laikam iekšs php tad strādā. Neredzu googlē neko tādu, kas man noderētu manā situācijā, varbūt akls esmu. Link to comment Share on other sites More sharing options...
Aleksejs Posted October 23, 2008 Report Share Posted October 23, 2008 http://codesnippets.joyent.com/posts/show/1225 Link to comment Share on other sites More sharing options...
andrisp Posted October 23, 2008 Report Share Posted October 23, 2008 LIMIT nav nekāds sakars ar PHP. Tā ir SQL fīča. Precīzāk MySQL. (Nu varbūt arī ir citām DB sistēmām, bet MSSQL tāds nav). Pašā pirmajā linkā komentāros ir visādi risinājumi: http://vorg.ca/626-the-MS-SQL-equivalent-t...s-limit-command Link to comment Share on other sites More sharing options...
NBS Posted October 23, 2008 Author Report Share Posted October 23, 2008 Izveidoju šādu kodu: SELECT * FROM (SELECT TOP 50 billsid, financ_ID, dat_no, dat_lidz, transfer_date, uid, uptime FROM (SELECT TOP 10 billsid, financ_ID, dat_no, dat_lidz, transfer_date, uid, uptime FROM bills) ) WHERE ind = 11 Kļūda saistībā ar iekavu ")" hmm. Link to comment Share on other sites More sharing options...
NBS Posted October 23, 2008 Author Report Share Posted October 23, 2008 Uh, sorry atradu jau risinājumu un pareizi uzrakstīju sintaksi. Paldies, par palīdzību ;) Link to comment Share on other sites More sharing options...
Recommended Posts