scalar_subquery = subquerysubquery = query_expression |
SELECT d.DeptNo, d.DeptName, SELECT COUNT * FROM pub.Employee e WHERE e.DeptNo = d.DeptNo AS Num_emp_in_dept FROM Department d; |
SELECT * FROM pub.Employee e WHERE SELECT MIN EmpNum + 2 FROM pub.Employee = SELECT MIN EmpNum FROM pub.Employee e, pub.Department d WHERE d.DeptCode = e.DeptCode AND d.DeptName='SALES' ; |
SELECT * FROM Employee WHERE Salary = SELECT AVG Salary FROM Employee + 1500; |
SELECT e.EmpNum, d.DeptCode, d.DeptName FROM pub.Employee e INNER JOIN pub.Department d ON SELECT DeptCode FROM pub.Employee where EmpNum = 1 = Select DeptCode FROM pub.Department WHERE DeptName = ‘Sales' ; |
INSERT INTO pub.Employee
VALUES 1001, ‘Scott', SELECT AVG Salary FROM pub.Employee , 102 ; |
DELETE FROM pub.Employee
WHERE DeptNum = SELECT d.DeptNum FROM pub.Department d WHERE DeptName = ‘Sales' |
CREATE VIEW V1 AS SELECT * FROM pub.Employee
WHERE SELECT MIN Salary FROM pub.Employee = SELECT MIN Salary FROM pub.Employee e, pub.Department d WHERE d.DeptNum = e.DeptNum AND DeptName = ‘Sales' |
CREATE TRIGGER TRG_TST02902_TEST01 BEFORE INSERT ON tst_trg_01
BEGIN //Inserting Into tst1 SQLIStatement insert_tst3 = new SQLIStatement "INSERT INTO tst_trg_03 VALUES SELECT AVG c2 FROM pub.t1 " ; insert_tst3.execute ; END |
SELECT Salary + SELECT AVG Salary FROM pub.Employee AS base_sal FROM pub.Employee; |
SELECT SELECT prod_name FROM pub.Products OrderId FROM pub.Orders |
SELECT SUM CustNum , COUNT CustNum FROMPub.MtCustomer WHERE CASE SELECT MIN CustNum FROM pub.MtCustomer WHEN SELECT MIN CustNum FROM pub.MtOrder THEN SELECT MAX CustNum FROM pub.MtCustomer ELSE SELECT MIN CustNum FROM pub.MtCustomer END = 2106; |
SELECT ROUND SELECT MIN CustNum + 0.5 FROM pub.MtCustomer WHERE Name = ‘Lift Tours-OEDProducts' ,0 FROM pub.MtCustomer; |