How to differentiate between the result sets retrieved for multiple OR conditions? I've a huge dataset which I'm quering with multiple OR conditions. Though I'm getting all the results, but I want to differentiate between the results that are retrieved for a certain where condition. Is there any way to do that? Here is an example - 

Select * from table where col1 like '%text1%' or col1 like '%text2%'


This query is retrieving entire matching dataset, but how can I differentiate between the results that are matching text1 or text2? Thanks in advance.
Typically I recommend materialising your resultset when this scenario has come up. Since queries of this nature are usually pretty broad and analytical (read: non-performant), this approach has the benefit of


reducing editing requirements (do you want to add the line to both the select and where clauses for each evaluation?)
snapshotting the underlying data for debugging
capturing "missed" rows from the underlying data that you thought you should have captured


Avoid:

Select 
    if(col1 like '%text1%',TRUE,FALSE) as a,
    if(col1 like '%text2%',TRUE,FALSE) as b,
    col1 
from table 
where col1 like '%text1%' 
   or col1 like '%text2%'


Prefer:

create temporary table foo as (
    Select 
        if(col1 like '%text1%',TRUE,FALSE) as a,
        if(col1 like '%text2%',TRUE,FALSE) as b,
        col1 
    from table 
);

select * 
from foo
where a
   or b;


Play with a demo of this approach on dbfiddle