Hi, I'm rather new to writing queries, so please forgive me if this is a really simple thing to do.

I need to create a CF query that finds out which rows in the DB have ANY of the values that are in a given list. Only one column in each row of the DB has their values stored in a list.

Example:

Passed list = 2,5,10,6

ColumX data in database:
Row 1 = 3, 5, 21, 4
Row 2 = 1, 4, 7, 9
Row 3 = 2
Row 4 = 8, 10, 3, 6
Row 5 = 1, 22, 9, 4

Base on the passed list, the query should return the following rows:
Row 1 (because 5 was in the list)
Row 3 (because 2 was in the list)
Row 4 (because 10 and 6 was in the list)

I’m hoping there’s some SQL function that works with lists and can compare the data sets of two lists to find matching values, but I don’t know.

Can anyone help?
thanks

Please be sure and clear in what do you want to say your question is not clear.
you want the passed list to be accept from user
or the passed list also in another table
let me now


Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.