开发者

query muliple fields with multiple values

i need a query that will do a dictiona开发者_StackOverflow社区ry like lookup in an ms-access database with vb6. The database contains a table and two fields A & B.

for example if A contains 1,2,3,4,5,6 and the corresponding values in B is a,b,c,d,e,f

then i will pass values 1,4,6 to the query, and it should return a,d,f

somthing like

SELECT * FROM table WHERE A = 1 and 2 and 6


If you are doing just one at a time then your query could look like this

SELECT B from table WHERE A=5

This would return the value in field B that relates when column A is 5

If you want to return multiple values then you could do this

SELECT A,B FROM table WHERN A IN(1,3,6,7)

This would return multiple values, you could then load those into an array and search for the value you want

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜