1.9.2 Example 2: Retrieve customer purchases from the customer table and sales history table (2 of 3)
Retrieve the customer ID (USERID), name (NAME), sex (SEX), product code (PUR-CODE), and date of purchase (PUR-DATE) from the sales history table (SALESLIST) and customer table (USERSLIST) for customers who meet the following condition:
-
Male customers who purchased a product on or after September 6, 2011
- Table to search
- Specification example
-
SELECT "SALESLIST"."USERID","NAME","SEX","PUR-CODE","PUR-DATE" FROM "SALESLIST","USERSLIST" WHERE "PUR-DATE">=DATE'2011-09-06' AND "SEX"='M' AND "SALESLIST"."USERID"="USERSLIST"."USERID"
- Retrieval results