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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 in (,,,,) question

Author  Topic 

Sun Foster
Aged Yak Warrior

515 Posts

Posted - 2005-08-20 : 07:09:43
I have a sql statement like:

select * from order where order_city in ("new york", ...)

There are about 50 cities need to type in.

Is there are another way to do the same job?

If I have a array in which stored city's name, how to input into "in (", ",...)"?

Kristen
Test

22859 Posts

Posted - 2005-08-20 : 09:24:20
You could JOIN to a table of valid cities, otherwise see "WHERE IN @MyCSV" here:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=53204

Kristen
Go to Top of Page
   

- Advertisement -