G
Guest
Have two tables. Table1 lists the number of stores per state that I need. Table2 lists all the available stores
I need to Select Distinct T2.StoreID, limiting the number of results to T1.Need where T1.State = T2.State
Example below. Can't figure out the SQL for this. Any ideas
Thanks
Mik
Table1
State Need
------ -----
NY
Table
State StoreID
----- ----------
NY 5
NY 5
NY 5
NY 5
NY 5
I need to Select Distinct T2.StoreID, limiting the number of results to T1.Need where T1.State = T2.State
Example below. Can't figure out the SQL for this. Any ideas
Thanks
Mik
Table1
State Need
------ -----
NY
Table
State StoreID
----- ----------
NY 5
NY 5
NY 5
NY 5
NY 5