Click here to Skip to main content
15,897,518 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi all,

I have a list with more than 100 items say 1A100 to 1A250 and I have a MySQL database in which one column may or may not contains an item in list, if the column contains any value from the list then select the row from the table.

1 | 1A100 | Test-1
2 | 2A100 | Test-2
3 | 1A250 | Test-3

I am aware of the functions REGEXP and NOT REGEXP but the list is too big so the command text may cross the permissible character limit.

Can anybody help me on this, thanks in advance.

-Manuprasad
Posted

1 solution

If I understand your question correctly, why not use IN operator?
Something like
SQL
SELECT *
FROM TableName
WHERE ColumnName IN ('1A100','1A250',...)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900