Quote
My thought is to update the quantity each time the database sees that (for example) customer number 1004 makes an order. BUT, how and where do I store this new variable without adding it to the database? I just want to display it.
Thanks
Posted 15 April 2012 - 05:40 PM
Quote
Posted 16 April 2012 - 05:22 AM
SELECT <Column1>,SUM(<Column2>) FROM <Table> WHERE <Conditions> GROUP BY <Column1> ORDER BY <Conditions>
This post has been edited by rgfirefly24: 16 April 2012 - 05:24 AM
Posted 16 April 2012 - 07:59 AM
rgfirefly24, on 16 April 2012 - 05:22 AM, said:
SELECT <Column1>,SUM(<Column2>) FROM <Table> WHERE <Conditions> GROUP BY <Column1> ORDER BY <Conditions>
Posted 16 April 2012 - 08:42 AM
skatingrocker17, on 16 April 2012 - 02:59 PM, said:
+----------+-----------+------------+ | forum_id | thread_id | post_count | +----------+-----------+------------+ | 1 | 1 | 5 | | 1 | 2 | 2 | | 2 | 3 | 1 | | 2 | 4 | 8 | | 2 | 5 | 3 | +----------+-----------+------------+
SELECT forum_id, COUNT(thread_id) AS thread_count, SUM(post_count) AS post_count FROM pointlessness GROUP BY forum_id;
+----------+--------------+------------+ | forum_id | thread_count | post_count | +----------+--------------+------------+ | 1 | 2 | 7 | | 2 | 3 | 12 | +----------+--------------+------------+
skatingrocker17, on 16 April 2012 - 02:59 PM, said:
Posted 16 April 2012 - 09:42 AM
Posted 16 April 2012 - 10:10 AM
Atli, on 16 April 2012 - 09:56 AM, said:
Posted 16 April 2012 - 10:33 AM
skatingrocker17, on 16 April 2012 - 05:10 PM, said:
SELECT `my uber data field` FROM `my special table` WHERE `nothing at all` IS NOT NULL
This post has been edited by Atli: 16 April 2012 - 10:34 AM
Posted 16 April 2012 - 03:52 PM
This post has been edited by skatingrocker17: 16 April 2012 - 05:32 PM
Posted 17 April 2012 - 05:17 AM
