sandrulis Posted December 11, 2010 Report Share Posted December 11, 2010 Atkal jautājums saistībā ar datubāzēm. Man datubāzē ieraksti: 'a ieraksts' 'a1 ieraksts' 'b ieraksts' 'c ieraksts' '45ieraksts' '21ieraksts' '99ieraksts' Veidojot alfabēta kārtību man skats apmēram tāds Sākumā kārto pēc burtiem: $result=mysql_query("SELECT * FROM ierakstu_baze WHERE name LIKE '$burts%' ORDER BY name ASC"); A____________________________________ 'a ieraksts' 'a1 ieraksts' B____________________________________ 'b ieraksts' C____________________________________ 'b ieraksts' Pēc tam kārto pēc cipariem un sākās problēmas: $result=mysql_query("SELECT * FROM ierakstu_baze WHERE name LIKE '$cipars%' ORDER BY name ASC"); 2_______________________________________________ '21ieraksts' 4_______________________________________________ '45ieraksts' 9_______________________________________________ '99ieraksts' Bet kā lai izveido, lai man ciparu alfābēts rādītos šādi? Kā būtu jāizskatās tam kodam $result=mysql_query("SELECT * FROM ierakstu_baze WHERE .... "); #________________________________________________________ '21ieraksts' '45ieraksts' '99ieraksts' Paldies jau iepriekš! Quote Link to comment Share on other sites More sharing options...
Mr.Key Posted December 11, 2010 Report Share Posted December 11, 2010 Un kāda tam saistība ar MySQL? Quote Link to comment Share on other sites More sharing options...
Grey_Wolf Posted December 11, 2010 Report Share Posted December 11, 2010 ORDER BY var satureet vairak kaa vienu kartoshanas noteikumu ORDER BY vards ASC cipars ASC Quote Link to comment Share on other sites More sharing options...
sandrulis Posted December 11, 2010 Author Report Share Posted December 11, 2010 sk, plds Grey_Wolf Quote Link to comment Share on other sites More sharing options...
Kemito Posted December 11, 2010 Report Share Posted December 11, 2010 Mr.Key - Sakars ir grupēšana. Quote Link to comment Share on other sites More sharing options...
briedis Posted December 11, 2010 Report Share Posted December 11, 2010 Mr.Key - Sakars ir grupēšana. wut? Grupēt tak vajag, ja ir agregācijas funkcijas.. 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.