Advertisement
hecrus

demo 2 Pie

Oct 17th, 2020
732
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.43 KB | None | 0 0
  1. CREATE PROCEDURE [dbo].[dashboard_tst-dashboard_pieTopProducts_getPanelChart]
  2. @username nvarchar(128)
  3. AS
  4. BEGIN
  5.     select 'pie' Type,
  6.            '' Title,
  7.            400 Width,
  8.            400 Height
  9.  
  10.     select top 5
  11.            name Title,
  12.            (select sum(cnt) from tst_orders where productID = tst_products.id) Value,
  13.            '' Color
  14.     from tst_products
  15.     order by (select sum(cnt) from tst_orders where productID = tst_products.id) desc
  16. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement