一条SQL语句的问题.在线等
select * from product,UserInfo where product.typeID=UserInfo.UserNum and product.spec=5000 order by usein,pid desc这样错了吗?其中product,UserInfo 是表名,product.typeID字段和UserInfo.UserNum字段一样,但是这样查不出结果
但少了and product.spec=5000 如下
select * from product,UserInfo where product.typeID=UserInfo.UserNum order by usein,pid desc
就可以查出来,请高手指教一下 没看出SQL有问题
会不会是Spec的类型与5000有问题的 “select * from product,UserInfo where product.typeID=UserInfo.UserNum order by usein,pid desc”执行这条语句由你想要的答案吗? 用另一种方法试试,join on 应该 用连接 你着样 肯定有错误 必须用内连接 对,用内联接试试 用内联连接 你试试
select * from product,UserInfo where product.spec=5000 order by usein,pid desc
这样可以查处数据吗?
要是这样不行就是spec的类型和5000不配等的问题了……
页:
[1]
