I have a table having data showing in picture
When I run
SELECT * from pb_results where pb_results.winning_numbers LIKE '%130736%' OR pb_results.winning_numbers LIKE '%130737%' OR pb_results.winning_numbers LIKE '%130738%'
and get result
result can be multiple rows and how can i know which row is against which like value.... For example in above example i would like to get a column with value 130736... which shows me this is row is against this 130736.... how can i do this?
SELECT pb.*, "130736" as search_value from pb_results pb where pb_results.winning_numbers LIKE '%130736%'
UNION
SELECT pb.*, "130737" as search_value from pb_results pb where pb_results.winning_numbers LIKE '%130737%'
UNION
SELECT pb.*, "130738" as search_value from pb_results pb where pb_results.winning_numbers LIKE '%1307378%';
Will provide you results with an additional column of search_value
which will have the search info that you request.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments