Hi,
I have a field in myTable ("States") that is a comma-delineated integer list.
RecordID States
------------------------------
1 1
2 1,2
3 12
I'm trying to write a query that will return rows where a specific integer value is present.
When I use the LIKE clause...
SELECT *
FROM myTable
WHERE States LIKE '%1%'
it returns:
RecordID States
------------------------------
1 1
2 1,2
3 12
If I use the IN clause...
SELECT *
FROM myTable
WHERE (States IN ('1'))
it returns:
RecordID States
------------------------------
1 1
instead of what I'm looking for which is:
RecordID States
------------------------------
1 1
2 1,2
What method should I be using here?
Thanks in advance for any help!!!
mD
I have a field in myTable ("States") that is a comma-delineated integer list.
RecordID States
------------------------------
1 1
2 1,2
3 12
I'm trying to write a query that will return rows where a specific integer value is present.
When I use the LIKE clause...
SELECT *
FROM myTable
WHERE States LIKE '%1%'
it returns:
RecordID States
------------------------------
1 1
2 1,2
3 12
If I use the IN clause...
SELECT *
FROM myTable
WHERE (States IN ('1'))
it returns:
RecordID States
------------------------------
1 1
instead of what I'm looking for which is:
RecordID States
------------------------------
1 1
2 1,2
What method should I be using here?
Thanks in advance for any help!!!
mD