Syntax for grouping results

To group data using GROUP BY, you can use the following sample syntax. WHERE and ORDER BY are optional:

SELECT column(s) 
FROM table
WHERE condition(s)
GROUP BY columns(s)
ORDER BY column(s);

To get subtotals and totals with GROUP BY and ROLLUPyou can use the following sample syntax: 

SELECT col1, col2, col3 
FROM table
GROUP
BY col2, col1, WITH ROLLUP;
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.113.193