الجمعة، 20 ديسمبر 2013

Return same row multiple times if search string matches with 2 columns - Mysql

I'm trying to display the result from the following table

id | string1 | string2 1 | mysql | php 2 | mysql | mysql 3 | python | java

If I search the string 'mysql' in the table from column string1 and string2, I would like to get results as

1 mysql 2 mysql 2 mysql

Row id 2 should display multiple times as 'mysql' is presents in 2 columns(string1 and string2).

Is there any feasiblity to list like above results.

Note : I dont want to use UNION all

Thanks


View the original article here

ليست هناك تعليقات:

إرسال تعليق