Re: lug-bg: MySQL update
UPDATE `table` SET credit = credit + 5 WHERE (user_id = 1 AND user_id = 4) OR (user_id = 7 AND user_id = 8); Za poveche informatsia http://www.mysql.com/doc/en/UPDATE.html ;-) HTH, Stratsimir martin petkov wrote: Zdraveite, bihte li me posyvetvali za slednata situacia iskam da update-na opredeleni stoinosti v dadena kolona po uslovie ot druga kolona v syshtata tablica naprimer |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
On Fri, Sep 19, 2003 at 05:28:43AM -0700, martin petkov wrote: |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . UPDATE t1 SET t1.credit=5 WHERE t1.user_id BETWEEN 1 AND 4 OR t1.user_id BETWEEN 7 AND 8 A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
Variant 1 update tablenmae set credit = credit + 5 where (user_id 0 and user_id 5) or (user_id 6 and user_id 8); Variant 2 update tablenmae set credit = credit + 5 where user_id in(1,2,3,4 , 7,8) Po princip ako beshe *normalna* baza danii ili mysql 4.1 i ako ti tribvah po slojjni nesta se praviat sas subselect no v tvoia sluchai ne e nujno. BIVOL -- - Original Message - From: martin petkov [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, September 19, 2003 3:28 PM Subject: lug-bg: MySQL update Zdraveite, bihte li me posyvetvali za slednata situacia iskam da update-na opredeleni stoinosti v dadena kolona po uslovie ot druga kolona v syshtata tablica naprimer |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Vasko Tomanov wrote: | pointeresuvaj se ot joint neshta Joint ?!? :)) 20 5 70 [EMAIL PROTECTED] ;8AB :))) -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/axRNKDHlLar/ewgRAnKiAJ9Xzgptcls8dfqxner3JsToo0MF1wCgvU3O oVg98WXthtSaXJCnjrp9MFc= =6mk2 -END PGP SIGNATURE- A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
On Friday 19 September 2003 15:28, martin petkov wrote: Zdraveite, bihte li me posyvetvali za slednata situacia iskam da update-na opredeleni stoinosti v dadena kolona po uslovie ot druga kolona v syshtata tablica naprimer |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| ] update tablename set credit=credit+5 where user_id=1 and user_id=4 and user_id=7 and user_id=8; t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com === = A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html === = A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 , ,:) - -:)). -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/axVbKDHlLar/ewgRAg4sAKCIdTf2vFyGCLKrAR8Vslmzd2LwYgCgtEgu OAy/NLKLxDBDzIEw/eDEgHs= =9LPE -END PGP SIGNATURE- A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Friday 19 September 2003 15:28, you wrote: |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . Zdravej ami primerno mojesh da napravish update database.table set credit = '(select credit + 5 from database.table where user_id= 'nekvo_id')' where user_id='syshtoto_id'; ako pravish neshto na nqkoq golqma/ vajna baza po dobre pyrvo procheti manuala tova go napisah bez da se zamislqm, no mislq che moje da ti sluji kato nasoka. - -- Regards, Miroslav Nikolov Dept. Gabrovo Game Network GLOBALCOM Ltd. -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE/ax4t3hvdMK8+7aoRAl4oAJ9bI91tjj/tCzIt+LwtTq3Xr+1U9gCeIcdA bozPh20lV3PNifnJ4g+vQGc= =T8J6 -END PGP SIGNATURE- A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
Re: lug-bg: MySQL update
,: sqlUPDATE `tablica` SET `credit`=5 WHERE `credit`11 sqlUPDATE `tablica` SET `credit`=5 WHERE (`user_id`4 OR `user_id`7) , martin petkov [EMAIL PROTECTED] wrote: (19/09/2003 14:28) bihte li me posyvetvali za slednata situacia iskam da update-na opredeleni stoinosti v dadena kolona po uslovie ot druga kolona v syshtata tablica naprimer |user_id|credit| |1 |10| |2 |10| |3 |10| |4 |10| |5 |20| |6 |20| |7 |10| |8 |10| t.e. kak da se update-nat stoinostite na credit (s 5 naprimer), koito sa s user_id ot 1-4 i 7-8 . A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers). http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html