Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
CREATE TABLE table1 ([account_number] int, [Amount] int) ; INSERT INTO table1 ([account_number], [Amount]) VALUES (13, 40), (14, 30), (14, 30), (13, 60), (14, 10) ; SELECT ( ( SELECT Sum(amount) FROM table1 WHERE account_number = 13 ) / ( SELECT Sum(amount) FROM ( SELECT Sum(amount) FROM table1 WHERE account_number IN (13, 14) GROUP BY account_number ORDER BY Sum(amount) ) ) )

Stuck with a problem? Got Error? Ask AI support!

Copy Clear