By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,045 Members | 1,743 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,045 IT Pros & Developers. It's quick & easy.

Better use of x or y or z....

P: n/a
Hi,

Can I use a hard-coded set in sql to make the code cleaner?

For example 'where x in {'CC','UG','WA','SS'}' rather than x='cc' or x='ug'
etc....

If so what's the correct syntax (i've tried various ways with no luck)

Thanks,
Chris
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Just use regular round brackets.

HTH
- Turtle

"Not Me" <su**@sumwhere.fake> wrote in message
news:bn**********@ucsnew1.ncl.ac.uk...
Hi,

Can I use a hard-coded set in sql to make the code cleaner?

For example 'where x in {'CC','UG','WA','SS'}' rather than x='cc' or x='ug' etc....

If so what's the correct syntax (i've tried various ways with no luck)

Thanks,
Chris

Nov 12 '05 #2

P: n/a
"MacDermott" <ma********@nospam.com> wrote in message
news:Nl*******************@newsread2.news.atl.eart hlink.net...
"Not Me" <su**@sumwhere.fake> wrote in message
news:bn**********@ucsnew1.ncl.ac.uk...
Hi,

Can I use a hard-coded set in sql to make the code cleaner?

For example 'where x in {'CC','UG','WA','SS'}' rather than x='cc' or x='ug'
etc....

Just use regular round brackets.


Cheers, I can't understand how I missed that (honestly tried quite a few
ways!)
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.