467,907 Members | 1,406 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,907 developers. It's quick & easy.

Is there an "In" expression?

Hello,

I was looking at a Access query and noticed in the criteria it stated:

In ('001','002')

Can someone please explain what the In is? How does it different from
Or?

Thank you,

Brian

Nov 13 '05 #1
  • viewed: 1092
Share:
4 Replies
BerkshireGuy wrote:
Hello,

I was looking at a Access query and noticed in the criteria it stated:

In ('001','002')

Can someone please explain what the In is? How does it different from
Or?


It would be the same as:

ID = '001' or ID = '002'

It's just an easier way of doing multiple ORs.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)
Nov 13 '05 #2
BerkshireGuy wrote:
In ('001','002')

Can someone please explain what the In is? How does it different from
Or?


Same as using or.

I don't know about Jet, but in Oracle, the SQL performance tuning texts
I have indicate it's a preferred syntax to using "or".

I also find in Jet or Oracle, it makes it easier for me, anyway, to
write SQL via VBA code.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Nov 13 '05 #3
DFS
MGFoster wrote:
BerkshireGuy wrote:
Hello,

I was looking at a Access query and noticed in the criteria it
stated:

In ('001','002')

Can someone please explain what the In is? How does it different
from Or?


It would be the same as:

ID = '001' or ID = '002'

It's just an easier way of doing multiple ORs.


It has additional functionality that can be handy: when used within the
PIVOT clause of a crosstab query, it will restrict the query output to and
force the output of only those columns listed in the "In ('val1',
'val2',...)" statement.
Nov 13 '05 #4
Tim Marshall wrote:
BerkshireGuy wrote:
In ('001','002')

Can someone please explain what the In is? How does it different from
Or?

Same as using or.

I don't know about Jet, but in Oracle, the SQL performance tuning texts
I have indicate it's a preferred syntax to using "or".


ISTR this was true in Access as well, dunno about now they keep changing
things :-)

--
This sig left intentionally blank
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Ronald W. Roberts | last post: by
10 posts views Thread by LaEisem | last post: by
4 posts views Thread by Diogo Alves - Software Developer | last post: by
2 posts views Thread by John Smith | last post: by
4 posts views Thread by michael.bollhoefer | last post: by
77 posts views Thread by M.B | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.