查询语句
关联表的写法
1.
select ... from a,b,c
where a... = b...
and c...= b...
2.
select * from (SELECT [hotelID], [hotelName], [hotelStar],
[CountryName]=(select C_Country_short from t_set_country where t_set_country.Country_Id=T_hotel.Country ),
[ProvinceName]=(select C_Province from t_set_province where t_set_province.Province_Id=T_hotel.Province ) ,
[CityName]=(select C_city from t_set_city where t_set_city.city_Id=T_hotel.City ),
[Postcode],[City],Country,Province, [hotelFax_Line], [hotelFaxCode], [hotelFax_AreaCode], [userCode], [hotelTele] FROM [T_hotel]) as tb";
where tb.Country='" + Request.QueryString["Id"] + "'
1.
select ... from a,b,c
where a... = b...
and c...= b...
2.
select * from (SELECT [hotelID], [hotelName], [hotelStar],
[CountryName]=(select C_Country_short from t_set_country where t_set_country.Country_Id=T_hotel.Country ),
[ProvinceName]=(select C_Province from t_set_province where t_set_province.Province_Id=T_hotel.Province ) ,
[CityName]=(select C_city from t_set_city where t_set_city.city_Id=T_hotel.City ),
[Postcode],[City],Country,Province, [hotelFax_Line], [hotelFaxCode], [hotelFax_AreaCode], [userCode], [hotelTele] FROM [T_hotel]) as tb";
where tb.Country='" + Request.QueryString["Id"] + "'
浙公网安备 33010602011771号