一分耕耘,一分收获

编程路上的成长与收获

 

查询语句

关联表的写法
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"] + "'

posted on 2007-07-25 15:31  如烟  阅读(181)  评论(0)    收藏  举报

导航