MS Access where in clause

Is it possible to write a where in clause in MS Access SQL?

Example:

select * from mytable where myfield in (select top 6 myfieldlookup from othertable) as t1
dougfosterNYCAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Connect With a Mentor Commented:
this is already good to go

select * from mytable where myfield in (select top 6 myfieldlookup from othertable)
0
 
Rey Obrero (Capricorn1)Commented:
yes..



0
 
dougfosterNYCAuthor Commented:
OMG.  It is the as t1 statement that screwed it up.  
 
Thanks....
0
 
rockiroadsCommented:
two things

with this, the table alias cannot be placed here like this (as t1). you would place it within the from part
second, myfield must match the datatype of myfieldlookup

select * from mytable where myfield in (select top 6 myfieldlookup from othertable)

0
 
rockiroadsCommented:
way too slow lol
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.