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
DECLARE @territoryid INT; DECLARE @city NVARCHAR(32); SET @territoryid = 3; SET @city = N'Seattle'; SELECT JSON_VALUE(Info, '$.Customer.Name') AS Customer, Status, SUM(SubTotal) AS Total FROM Sales.SalesOrder_json WHERE TerritoryID = @territoryid AND JSON_VALUE(Info, '$.ShippingInfo.City') = @city AND OrderDate > '1/1/2015' GROUP BY JSON_VALUE(Info, '$.Customer.Name'), Status HAVING SUM(SubTotal) > 1000; EXEC sp_executesql

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

Copy Clear