andrisp Posted May 17, 2005 Report Share Posted May 17, 2005 kaads datutips mysql laukam man jaanoraada, lai vareetu rakstiit gan 14.5 gan 14,5 un vinjs abus uztvertu abus vienaadi, jeb abus kaa decimaalus skaitljus ? un taa lai peec tam izmantojot piemeram ORDER BY lauks DESC vinjs arii kaartotu korekti ? Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 17, 2005 Report Share Posted May 17, 2005 kaads datutips mysql laukam man jaanoraada, lai vareetu rakstiit gan 14.5 gan 14,5 un vinjs abus uztvertu abus vienaadi, jeb abus kaa decimaalus skaitljus ? un taa lai peec tam izmantojot piemeram ORDER BY lauks DESC vinjs arii kaartotu korekti ? 17600[/snapback] izdari korekcijas pirms vadiishanas DB un viss Link to comment Share on other sites More sharing options...
bubu Posted May 17, 2005 Report Share Posted May 17, 2005 A tu php kodā nomaini visus , uz . un būs ok. Link to comment Share on other sites More sharing options...
andrisp Posted May 17, 2005 Author Report Share Posted May 17, 2005 es atklaaju, ka var kaartot arii parastus tekstu laukus kur ir piemeeram '3.5 Ls' , '6,7 Ls', '8 Ls'. vinjs kaarto gandriiz korekti neskatoties uz tiem 'Ls' biegaas un vai ir punkts vai komats.. gandriiz taapee, kaa nezkaapeec '100 Ls' vinjs uzskata par mazaaku nekaa piem. '3.5 Ls'. Link to comment Share on other sites More sharing options...
bubu Posted May 17, 2005 Report Share Posted May 17, 2005 Nu bet loģiski. Salīdzinot kā stringus '1'<'3' un tālāk nemaz neskatās. arī '100000 Ls'<'3.5 Ls'. Tur nevis 'gandrīz' salīdzina pareizi, bet gan salīdzina absolūti nepareizi :) Link to comment Share on other sites More sharing options...
andrisp Posted May 17, 2005 Author Report Share Posted May 17, 2005 baigais vinjs ir.. hmm .. a kaapeec vinjs nesaliidzina visu ciparu rindu ? nevar taa kautkaa buut nebuut ? Link to comment Share on other sites More sharing options...
Delfins Posted May 17, 2005 Report Share Posted May 17, 2005 baigais vinjs ir.. hmm .. a kaapeec vinjs nesaliidzina visu ciparu rindu ? nevar taa kautkaa buut nebuut ? 17610[/snapback] takšu glabā ciparus nevis stringu Link to comment Share on other sites More sharing options...
bubu Posted May 17, 2005 Report Share Posted May 17, 2005 A kāpēc būtu jāsalīdzina kā cipari? Ja jau tu pasaki, ka lauks ir strings (CHAR/VARCHAR), tas tiks arī tā salīdzināts. Kam ta citam domāti kolonnu tipi? Nu var jau vēl CASTot, tipa konvertēt uz skaitļiem pie ORDER BY griežot ārā substringu, bet nu tas būs lēni, tur laikam nemaz indeksi netiks izmantoti. Kam tādas perversijas vajadzīgas, nez... Link to comment Share on other sites More sharing options...
andrisp Posted May 17, 2005 Author Report Share Posted May 17, 2005 ok, pietureeshos pa stabilaam veertiibaam. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 17, 2005 Report Share Posted May 17, 2005 baigais vinjs ir.. hmm .. a kaapeec vinjs nesaliidzina visu ciparu rindu ? nevar taa kautkaa buut nebuut ? 17610[/snapback] nu un ko tas dos 3,5 vienalga buus lielaaks nekaa 100 :) Tas tachu ir strings :) nevis skaitlis :) Galabaa tachu skaitljus un ja nepiecieshams klaat kautkaadas piebildes (cik sapratu tad naudas vieniibas) - taas glabaa atseviskjaa kolonnaa un viss :) Link to comment Share on other sites More sharing options...
andrisp Posted May 17, 2005 Author Report Share Posted May 17, 2005 okei okei :).. bet kaadu lai noraadu tipu ? noraadot INT vinjs man 8.00 paartaisa par vienkaarsi 8 Link to comment Share on other sites More sharing options...
Grey_Wolf Posted May 17, 2005 Report Share Posted May 17, 2005 okei okei :).. bet kaadu lai noraadu tipu ? noraadot INT vinjs man 8.00 paartaisa par vienkaarsi 8 17616[/snapback] :lol: :lol: :lol: :lol: :lol: ir tachu ne tikai INT TINYINT - (-127) - 127 Vai 0-255 (ja noraadiits UNSIGNED) SMALLINT - (-32768) - 32767 Vai 0- 65535(ja noraadiits UNSIGNED) MEDIUMINT - man tos skaitljus slinkums rakstiit INT BIGINT ------------- FLOAT DOUBLE -------- utt.... Link to comment Share on other sites More sharing options...
hmnc Posted May 17, 2005 Report Share Posted May 17, 2005 iesaku arī ievadīt maksimāli tīrus datus. tb - bez Ls, $ utt. mēsliem. tīri cipariņi un miers. Link to comment Share on other sites More sharing options...
Kavacky Posted May 17, 2005 Report Share Posted May 17, 2005 noraadot INT vinjs man 8.00 paartaisa par vienkaarsi 8Bet kāda tur starpība? Link to comment Share on other sites More sharing options...
andrisp Posted May 17, 2005 Author Report Share Posted May 17, 2005 ai labi neko.. viss ir ok. Link to comment Share on other sites More sharing options...
Recommended Posts