Define views for queries that you use frequently.
Suppose you frequently need to list employees by department. The following query creates a list of all employees by department and state that you can run against iqdemo:
SELECT Departments.DepartmentID, Departments.DepartmentName, Employees.EmployeeID, Employees.GivenName,Employees.Surname, Employees.Phone FROM Departments, Employees ORDER BY Employees.State
Running the query creates a results set that looks like this:
DepartmentID |
DepartmentName |
EmployeeID |
GivenName |
Surname |
Phone |
---|---|---|---|---|---|
100 |
R & D |
148 |
Julie |
Jordan |
6175557835 |
200 |
Sales |
148 |
Julie |
Jordan |
6175557835 |
300 |
Finance |
148 |
Julie |
Jordan |
6175557835 |
400 |
Marketing |
148 |
Julie |
Jordan |
6175557835 |
--- |
--- |
--- |
--- |
--- |
--- |