I would like to run three queries in a procedure and return the results as one dataset. The reason I would like to run three is, this is a search procedure for searching a parts list so if the user enters Part1. I would then like to search for exact matches.
Then search for Like 'Part1%' and then Like '%Part1%'
. I would then have three results where exact matches are in one list and another list that begin with Part1 and then anything with Part1 in the third list.
Q 1 Am I going about this the correct way (using three selects)?
Q 2. If this is the correct way, how do I combine the results to become one set of data?
Thanks T
Age is a consequence of experience
Then search for Like 'Part1%' and then Like '%Part1%'
Code:
select * from parts where name = pSearchName;
select * from parts where name LIKE 'pSearchName%'
select * from parts where name LIKE '%pSearchName%'
Q 1 Am I going about this the correct way (using three selects)?
Q 2. If this is the correct way, how do I combine the results to become one set of data?
Thanks T
Age is a consequence of experience