|
djb27
Starting Member
USA
1 Posts |
Posted - 02/26/2013 : 22:02:22
|
Hi Everyone,
I have 3 tables: BASKET, STORE_MSA, and SKUINFO having between hundreds and thousands of rows of data. I am trying to identify the number of customers (in the table defined as BASKETNO) served across stores over the year. I only need to identify the customers from Illinois.
BASKET has the following columns: BASKETNO, STORE, DEPT, DEPTDESC, STYLE, SKU, QTY, AMT, RETAIL, ORGPRICE, COST, BRAND, SALEDATE
STORE_MSA has the following columns: STORE, CITY, STATE, ZIP, MSA, MSA_NAME, MSA_POP, MSA_REGION
Some assistance would be greatly appreciated!
David Burr |
|
|
khtan
In (Som, Ni, Yak)
Singapore
16769 Posts |
Posted - 02/26/2013 : 22:11:11
|
probably something like this
SELECT COUNT (*)
FROM BASKET b
INNER JOIN STORE_MSA s ON b.STORE = s.STORE
WHERE b.SALEDATE BETWEEN '2012-01-01' AND '2012-12-31' AND CITY = 'xxx' if it is not what you wanted, please do post some sample data and the expected result
KH Time is always against us
|
Edited by - khtan on 02/26/2013 22:12:45 |
 |
|