Warnung: file_put_contents(/home/www/web1/html/php_dev/test.txt) [function.file-put-contents]: failed to open stream: Permission denied in /home/www/web1/html/php_dev/sys/lib.activity.php (Zeile 58)
[MySQL 3.23.X] ganz simples addieren zweier werte????! [Archiv] - PHP-Scripte PHP-Tutorials PHP-Jobs und vieles mehr
ebiz-webhosting
- Ad -
php-resource




Archiv verlassen und diese Seite im Standarddesign anzeigen :
[MySQL 3.23.X] ganz simples addieren zweier werte????!


 
norman79
12-11-2003, 18:03 
 
hallo!

irgendwie, krieg ich heut nichts mehr gebacken!!!! wie addiert man werte zweier tabellen mit mysql??!

folgende abfrage funkt nicht:
tab1:
produkt|anzahl (format: varchar,bigint)
a|1
b|2

tab2:
produkt|anzahl
a|5
b|12

select tab1.produkt, (tab1.anzahl + tab2.anzahl) from tab1, tab2;

whats wrong?

verzeifelten gruß,
norman

 
goth
12-11-2003, 18:14 
 
select tab1.produkt, (tab1.anzahl + tab2.anzahl) from tab1, tab2 where tab1.produkt = tab2.produkt;

 
MelloPie
12-11-2003, 18:15 
 
Du musst den Join noch ein bauen


Alle Zeitangaben in WEZ +2. Es ist jetzt 16:00 Uhr.