Javascript 创建具有多个内部联接的搜索服务?

Javascript 创建具有多个内部联接的搜索服务?,javascript,mysql,sql,web-services,inner-join,Javascript,Mysql,Sql,Web Services,Inner Join,我正在为search restful web服务执行SQL查询。它工作正常,但我想获得表名like子句匹配的特定列名(仅限): SELECT Cou.country_id,cou.country_name, Sta.state_id, Sta.state_name, Dis.district_id, Dis.district_name,Cit.city_id, Cit.city_name,Loc.location_id,Loc.location_name,Sub_Loc.sub_loca

我正在为search restful web服务执行SQL查询。它工作正常,但我想获得表名like子句匹配的特定列名(仅限):

    SELECT Cou.country_id,cou.country_name, Sta.state_id, Sta.state_name, Dis.district_id,
Dis.district_name,Cit.city_id, Cit.city_name,Loc.location_id,Loc.location_name,Sub_Loc.sub_location_id,Sub_Loc.sub_location_name,Prop.property_id,Prop.property_name,Prop.hp_builders_id,
Bud.builders_id,Bud.builders_name
FROM hp_country Cou
INNER JOIN hp_state Sta ON Cou.country_id = Sta.hp_country_id
INNER JOIN hp_district Dis ON Sta.state_id = Dis.hp_state_id
INNER JOIN hp_city Cit ON Dis.district_id = Cit.hp_district_id
INNER JOIN hp_location Loc ON Cit.city_id = Loc.hp_city_id
INNER JOIN hp_sub_location Sub_Loc ON Loc.location_id = Sub_Loc.hp_location_id
INNER JOIN hp_property Prop ON Sub_Loc.sub_location_id=Prop.hp_sub_location_id
LEFT JOIN hp_builders Bud ON Prop.hp_builders_id=Bud.builders_id
where (Cou.country_status=1 AND Sta.state_status=1 AND Cou.country_id=1)    
AND (Dis.district_name LIKE '%ky%' OR Cit.city_name LIKE '%ky%' OR Loc.location_name LIKE '%ky%' OR Sub_Loc.sub_location_name LIKE '%ky%' OR Prop.property_name LIKE '%ky%')
我将把参数从客户端发送到web服务,如search=%ky%,以便它可以匹配到state/district/country/properties/builders, 我正在获取特定行中的所有值。假设它在属性名(skyline)中匹配,则提供所有细节 天际线(如位置、建筑商、城市)。但我只想得到特定表的匹配列名。 例如:

  • 行属性名称(天际线),属性id(1)
  • 行生成器名称(天际线),生成器id(9)
  • 行位置名称(技能印度),位置id(10)