Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here is idea i have 6 different fields to allow search if i give the option for user to enter value in any of 6 option or enter combined fields how to use sql query to retrieve the value.
For example the fields are author, publication, price, subject, edition, bookid
and if user enter only one value i could search but if user enter more than one if i try combinations then there are many combination.
Please suggest me how to define the query?
Posted

1 solution

In a stored procedure, create a temporary field which concatenate all these fields data (row wise). Then in the resulted field search any matching fragment is there are not.Score the matches.
Choose the best scored 1 or 10.

You may expect better answer. I am posting this as one of the option.

I just posted one way, you may try better ways or change your search strategy giving separate boxes for each fields
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900