Sunday, November 7, 2010

Rodent Ulcer More Condition_symptoms / ** SUBQUERIES **


MLXC

expression is an expression that seeks the resulting set of the subquery.

sqlstatement

A SELECT statement that follows the same format and rules as any other SELECT statement. Must be enclosed in parentheses.
You can use a subquery instead of an expression in the field list of a SELECT statement or a WHERE or HAVING clause. In a subquery SELECT statement is used to provide a set of one or more specified values to assess the expression of the WHERE or HAVING clause.
can be usedyears in the subquery. If you change ANY to ALL the above example, the query returns only those products whose unit price is greater than that of all products sold at a discount equal to or greater than 25 percent. This is much more restrictive. The predicate is used to retrieve only those records from the main query for which some records in the subquery contains an equal value. The following example returns all products sold at a discount equal to or greater than 25 percent.: SELECT * FROM Products WHERE ProductID IN
(SELECT ProductID FROM DetallePedido WHERE Discount> = & nbsLXC Gets a list with the name, title and salary of all the sales agents whose salary is greater than all the heads and directors.
DISTINCTROW SELECT ProductName, Precio_Unidad FROM Products WHERE (Precio_Unidad = (SELECT FROM Products WHERE
Precio_Unidad Nombre_Producto = "Aniseed Syrup");

Gets a list of the names and unit prices of all products with the same price as anise syrup.


SELECT DISTINCTROW Nombre_Contacto, Nombre_CompaƱia, Cargo_Contacto, & nbsp, Phone FROM Customers WHERE (customer_id IN (SELECT customer_id DISTINCTROW
FROM Orders WHERE Fecha_Pedido> = # 4/1/1993 # \u0026lt;# 01/07/1993 #);



Gets a list of companies and contacts of all customers who have placed an order in the second quarter of 1993.



SELECT FirstName, LastName FROM Employees AS E
WHERE EXISTS (SELECT * FROM Orders AS O WHERE O. EMPLOYEEIDNO = E. EMPLOYEEIDNO)



Select the name of all employees who have booked at least one order.

, &

0 comments:

Post a Comment