Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
select * FROM docsearchprofile as dp
Join docsearchaddress as da on da.`FK_DocSearchProfile` =     dp.`ID_DocSearchProfile` and da.`Mode`='P'
JOIN docsearchexperience as de on de.`FK_DocSearchProfile` = dp.`ID_DocSearchProfile`
JOIN designation as d on d.id_designation = de.FK_Specialisation
JOIN docsearchhospital as dh on dp.ID_DocSearchProfile = dh.FK_DocSearchProfile and dh.DefaultView=1
WHERE
MATCH(dp.`Name`) AGAINST ('@name' IN BOOLEAN MODE)
OR Match(d.`designation`)  AGAINST ('@designation' IN BOOLEAN MODE)
OR Match(dh.`HospitalName`) AGAINST ('@hospitalname' IN BOOLEAN MODE)
OR MATCH(da.`HouseName`) AGAINST ('@housename' IN BOOLEAN MODE)
OR match(da.`StreetName`) AGAINST('@streetname' IN BOOLEAN MODE)


input
VB
@name=''
@designation='+ENT*'
@hospitalname=''
@housename=''
@streetname=''


result

VB
1.Name:asdf
  Data:ENT

2.Name:zxcv
  Data:ENT



input
VB
@name='+Z*'
@designation='+ENT*'
@hospitalname=''
@housename=''
@streetname=''


result

VB
1.Name:asdf
  Data:ENT

2.Name:zxcv
  Data:ENT



SQL
in last search the 2 outputs...
But according to the input it will appear only the 2nd one in the 2nd result...

Posted
Updated 6-Apr-15 20:13pm
v2
Comments
CHill60 7-Apr-15 3:43am    
What are the values of the other columns for these items - you've used OR in the WHERE clause so any of them could match the input

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