• MySQL select rows where the sum of the rows is at least a value

    January 7, 2020

    Example table: CREATE TABLE a (`id` int, `value` decimal(5,2)) ; INSERT INTO a (`id`, `value`) VALUES (1, 5), (2, 1.25), (3, 3.7), (4, 17.3) ; Goal – getting the rows in which the sum of value is 9.5 SET @counter := 0; SELECT a.*, IF(@counter

Warning: Use of undefined constant XML - assumed 'XML' (this will throw an Error in a future version of PHP) in /home/c2kblate/sites/ivangospodinow.com/wp-content/plugins/wp-syntaxhighlighter/wp-syntaxhighlighter.php on line 1048
Powered by Wordpress and MySQL. Theme by Shlomi Noach, openark.org