zintis8789 Posted November 20, 2009 Report Share Posted November 20, 2009 Vai ir tads mysql kods lidzigs šim bet strādā: SELECT * FROM `kk` WHERE kk='pp' ORDER BY `kautkas`.`'dati1'-'dati2' Man vajag lai jau select logā atņem skaitļus Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 20, 2009 Report Share Posted November 20, 2009 select (stabins1 - stabins2) AS stabinstarpiba FROM tabula Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 Ja vari uzraksti to kodu kā gatavu sql kodu. Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 20, 2009 Report Share Posted November 20, 2009 Tas ir gatavs sql kods tabulai ar nosaukumu "tabula", kurā ir šādi divi skaitliski stabiņi "stabins1" un "stabins2". Es nezinu, kāda ir Tevi interesējošās tabulas struktūra. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 Nu man ir šāds php kods: $sql="SELECT SQL_CALC_FOUND_ROWS * FROM `stati` WHERE pos='Goalie' ORDER BY `stati`.`PPG` DESC LIMIT 0, 30 "; Un man vajag izvilt no datubazes: S - PPG Quote Link to comment Share on other sites More sharing options...
Aleksejs Posted November 20, 2009 Report Share Posted November 20, 2009 $sql="SELECT SQL_CALC_FOUND_ROWS, (S - PPG) AS Starpiba, visa, parejas, vajadzigas, kolonnas FROM `stati` WHERE pos='Goalie' ORDER BY `stati`.`PPG` DESC LIMIT 0, 30 "; Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 (edited) AA nekas tiko izlaboju kļūdu :D Edited November 20, 2009 by zintis8789 Quote Link to comment Share on other sites More sharing options...
Val Posted November 20, 2009 Report Share Posted November 20, 2009 atver manuāli un izlasi pareizo variantu. Quote Link to comment Share on other sites More sharing options...
zintis8789 Posted November 20, 2009 Author Report Share Posted November 20, 2009 Manuāli nav rakstīts kaa var tagad var sakartot. ORDER BY `stati`.`(`S` - `PPG`) AS `Starpiba` Ierakstu tadu kodu met uzreiz erroru: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'S` - `PPG`) AS `Starpiba` DESC LIMIT 0, 30' at line 1 Quote Link to comment Share on other sites More sharing options...
xPtv45z Posted November 20, 2009 Report Share Posted November 20, 2009 Izlasi manualī ko šis nozīmē - "`stati`." Quote Link to comment Share on other sites More sharing options...
Gints Plivna Posted November 20, 2009 Report Share Posted November 20, 2009 Manuāli nav rakstīts kaa var tagad var sakartot. ORDER BY `stati`.`(`S` - `PPG`) AS `Starpiba` Ja nu, lai cik tas nebūtu dīvaini, manuāļos nav rakstīts par katru konkrēto gadījumu, kas rodas izstrādes procesā. Baigi besīgi, protams, es piekrītu. Bet vispār jau klīst runas, ka cilvēkiem esot, piemēram, tādas spējas kā lietot analoģiju, un tad visus iespējamos bezgalīgi daudzos variantus manuālī var neuzskaitīt... 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.