let's say we have two tables connected like this:
SELECT a.saved_list_id, COUNT(b.saved_list_entry_id)
FROM saved_list a
LEFT OUTER JOIN saved_list_entry b ON (a.saved_list_id = b.saved_list_id)
GROUP BY a.saved_list_id;
so update will be looking like follows:
update saved_list p JOIN saved_list_entry c ON p.saved_list_id = c.saved_list_id
SET p.`number_entries` = (SELECT count(saved_list_entry_id) as number_entries
FROM saved_list_entry c where c.saved_list_id = p.saved_list_id)
Subscribe to:
Post Comments (Atom)
imagemagic add text to image
rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...
-
Error:The element 'Schedule' has invalid child element 'RecurrenceRule'. List of possible elements expected: 'Occurring&...
-
Perfect blog post must include following elements (from 1 to 13): 1.Big catchy header in 30px font size 2.First copy of social links and com...
-
SetKeyDelay , 75 , 75 ;Exits AutoHotKey application. $^CapsLock:: ExitApp return ;Pauses AutoHotKey Script. F6:: Pause , Toggle, 1 $x:: ...
No comments:
Post a Comment