Whatever message this page gives is out now! Go check it out!
SELECT * FROM employees
SELECT * FROM employees WHERE DeptID=3
SELECT LastName, FirstName FROM employees WHERE DeptID=3
INSERT INTO employees(EmpID, LastName, Firstname) VALUES(51, 'Doe', 'John')
Keyword | Description |
SELECT | Retrieves the specified records. |
INSERT | Adds a new row. |
UPDATE | Changes values in the specified rows. |
DELETE | Removes the specified rows. |
Keyword | Description |
FROM | Names the data tables for the operation. |
WHERE | Sets one or more conditions for the operation. |
ORDER BY | Sorts the result set in the specified order. |
GROUP BY | Groups the result set by the specified select list items. |
Operator | Description |
AND | Both conditions must be met |
OR | At least one condition must be met |
NOT | Exclude the condition following |
LIKE | Matches with a pattern |
IN | Matches with a list of values |
BETWEEN | Matches with a range of values |
= | Equal to |
<> | Not equal to |
< | Less than |
> | Greater than |
<= | Less than or equal to |
>= | Greater than or equal to |
+ | Addition |
- | Subtraction |
/ | Division |
* | Multiplication |
<cfset foo="bar">
<CFSET FOO="BAR">
<CfSet FOO="bar">
SELECT LastName FROM EMPLOYEES
SELECT LASTNAME FROM employees
<cfset List = "'Suisun', 'San Francisco', 'San Diego'">
<cfquery name = "GetCenters" datasource = "cfdocexamples">
SELECT Name, Address1, Address2, City, Phone
FROM Centers
WHERE City IN (#PreserveSingleQuotes(List)#)
</cfquery>
SELECT column_names
FROM table_names
[ WHERE search_condition ]
[ GROUP BY group_expression ] [HAVING condition]
[ ORDER BY order_condition [ ASC | DESC ] ]
SELECT * FROM employees WHERE DeptID=3
SELECT LastName, FirstName FROM employees WHERE DeptID=3
SELECT * FROM employees WHERE DeptID=3
SELECT * FROM employees WHERE DeptID=3 AND Title='Engineer'
SELECT * FROM employees ORDER BY LastName
SELECT * FROM employees ORDER BY DepartmentID, LastName
SELECT FirstName, LastName, Phone FROM employees
SELECT the FirstName, LastName, Phone
FROM employees
ORDER BY LastName, FirstName
SELECT EmpID, LastName, EQ as MyEQ FROM employees
SELECT LastName, FirstName, Street, City, State, Zip
FROM employees, addresses
WHERE employees.EmpID = addresses.EmpID
ORDER BY LastName, FirstName
INSERT INTO table_name(column_names) VALUES(value_list)
INSERT INTO employees(EmpID, LastName, Firstname) VALUES(51, 'Smith', 'John')
UPDATE table_name
SET column_name1=value1, ... , column_nameN=valueN
[ WHERE search_condition ]
UPDATE employees SET Email='jsmith@mycompany.com' WHERE EmpID = 51
UPDATE employees SET Email = 'jsmith@mycompany.com'
DELETE FROM table_name
[ WHERE search_condition ]
DELETE FROM employees
DELETE FROM employees WHERE EmpID=51
<cftransaction>
<cfquery name="qInsEmp" datasource="cfdocexamples">
INSERT INTO Employees (FirstName,LastName,EMail,Phone,Department)
VALUES ('Simon', 'Horwith', 'SHORWITH','(202)-797-6570','Research and Development')
</cfquery>
<cfquery name="qGetID" datasource="cfdocexamples">
SELECT MAX(Emp_ID) AS New_Employee
FROM Employees
</cfquery>
</cftransaction>