Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
sriviswa
Starting Member
1 Post |
Posted - 2005-06-29 : 07:00:54
|
Hi,I have a table product_cities that has product_id+city_id as its key.I need to find all products that are listed within a selected list of cities. The product should be listed in each and every city selected.Suppose I select Boston, Chicago and Denver, the select should list all products that is listed in each of these cities.Hope I made myself clear.And thx for all the help.Vis. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-06-29 : 07:23:51
|
| Something like Select columns from products where City in (Citylists)Can you post the table structures?MadhivananFailing to plan is Planning to fail |
 |
|
|
eralper
Yak Posting Veteran
66 Posts |
Posted - 2005-06-29 : 16:17:16
|
| Hi,Is you need a table with columns cityname, productname?select city_name, product_namefrom product_cities, cities, productswhere product_cities.city_id = cities.city_id and product_cities.product_id = products.product_id and cities.city_name in ('Boston', 'Chicago', 'Denver')order by cities.city_nameEralper-------------Eralperhttp://www.kodyaz.com |
 |
|
|
|
|
|