Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.
SELECT SUM( SELECT COUNT(*) FROM myTable WHERE `ref` = `u`.`id` GROUP BY `myRow` ) AS `mySum` FROM `users` `u` -------------------------------- SELECT ( SELECT SUM( `myCount` ) AS `mySum` FROM ( SELECT COUNT( * ) `myCount` FROM myTable WHERE `ref` = `u`.`id` GROUP BY `myRow` ) `subtable` ) FROM `users` `u` // This query says it can't define what `u` is. The other query won't let me SUM this reference... however, if i SUM it up on it's own with a static reference, it works.
|How do I get the total count of rows inserted and updated today(SQL SERVER 2012, SSIS 2012)||12||49|
|SQL QUERY to Table question||32||60|
|How to select/populate table with most current records||2||49|
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
21 Experts available now in Live!