Basic SQL Structure

SELECT *
FROM Table;

This is as simple as it gets.


Simple Query

SELECT ID, NAME
FROM Table
WHERE ID = 3;

 

Finding Unique Values

SELECT DISTINCT NAME
FROM Table
GROUP BY NAME;

 

Counting Groups of Occurrences

SELECT DISTINCT NAME, COUNT(*)
FROM Table
GROUP BY NAME;

 

Math

sdf

Summarize groups of data with math functions

SELECT OBJECTID_1, NAME, Sum(ap_amtreq) AS AmtReq
FROM Applications_Awards
GROUP BY NAME, OBJECTID_1
ORDER BY OBJECTID_1 ASC;


Write your query to a new table

SELECT OBJECTID_1, NAME, Sum(ap_amtreq) AS AmtReq
INTO AmtRequested02
FROM Applications_Awards
GROUP BY NAME, OBJECTID_1
ORDER BY OBJECTID_1 ASC;