हां, MySQL "WHERE..OR" का एक विकल्प REGEXP का उपयोग करना है।
पहले एक टेबल बनाते हैं:
mysql> create table DemoTable684(EmployeeInformation text); Query OK, 0 rows affected (0.68 sec)
इन्सर्ट कमांड का उपयोग करके टेबल में कुछ रिकॉर्ड डालें:
mysql> insert into DemoTable684 values('John 21 Google'); Query OK, 1 row affected (0.15 sec)
mysql> insert into DemoTable684 values('Carol 23 Amazon'); Query OK, 1 row affected (0.16 sec)
mysql> insert into DemoTable684 values('Carol 26 Flipkart'); Query OK, 1 row affected (0.12 sec)
mysql> insert into DemoTable684 values('David 29 Microsoft'); Query OK, 1 row affected (0.18 sec)
सेलेक्ट स्टेटमेंट का उपयोग करके टेबल से सभी रिकॉर्ड प्रदर्शित करें:
mysql> select *from DemoTable684;
यह निम्न आउटपुट देगा:
+---------------------+ | EmployeeInformation | +---------------------+ | John 21 Google | | Carol 23 Amazon | | Carol 26 Flipkart | | David 29 Microsoft | +---------------------+ 4 rows in set (0.00 sec)
REGEXP का उपयोग करके MySQL WHERE...OR लागू करने की क्वेरी:
mysql> select *from DemoTable684 where EmployeeInformation REGEXP '(David|29|Microsoft)';
यह निम्न आउटपुट देगा:
+---------------------+ | EmployeeInformation | +---------------------+ | David 29 Microsoft | +---------------------+ 1 row in set (0.00 sec)