You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SELECT CustomerName AS Name, City, Country, 'CUSTOMER'FROM Customers
UNIONSELECT SupplierName, City, Country, 'SUPPLIER'FROM Suppliers
ORDER BY Name;
합집합(UNION)
SELECT CategoryID AS ID FROM Categories
WHERE CategoryID >4UNIONSELECT EmployeeID AS ID FROM Employees
WHERE EmployeeID % 2=0;
교집합(WHERE AND)
SELECT CategoryID AS ID FROM Categories C, Employees E
WHEREC.CategoryID>4ANDE.EmployeeID % 2=0ANDC.CategoryID=E.EmployeeID
차집합(NOT IN)
SELECT CategoryID AS ID FROM Categories
WHERE
CategoryID >4AND CategoryID NOT IN (
SELECT EmployeeID
FROM Employees
WHERE EmployeeID % 2=0)
대칭차집합(UNION ALL)
SELECT ID FROM (
SELECT CategoryID AS ID FROM Categories
WHERE CategoryID >4UNION ALLSELECT EmployeeID AS ID FROM Employees
WHERE EmployeeID % 2=0
) AS Temp
GROUP BY ID HAVINGCOUNT(*) =1-- 중복되는 데이터들 제거
CASE WHEN ~ THEN ~ ELSE ~ END
CASE
WHEN '조건' THEN '출력할 데이터'
ELSE '출력할 데이터'
END
CASE
WHEN OUT_DATE <=DATE('2022-05-01') THEN '출고완료'
ELSE CASE WHEN OUT_DATE IS NULL THEN '출고미정'
ELSE '출고대기'
END
END