读书人

一个简单的多表查询的有关问题请赐教

发布时间: 2012-03-21 13:33:14 作者: rapoo

一个简单的多表查询的问题,请赐教。
table a 中的字段aa,bb,cc
table b 中的字段ee,ff,hh
查询a中的aa,与b中的ee字段,条件是 bb的大小在ff 与hh之间。谢谢。
我的查询语句:
select a.aa, b.ee from table a, b where a.bb between b.ff and b.hh.


[解决办法]
select a.aa, b.ee from a, b where a.bb between b.ff and b.hh

哦,是把table删除,留下from
[解决办法]
select distinct a.aa from a, b where a.bb between b.ff and b.hh

读书人网 >SQL Server

热点推荐