select * from dbcontinfo where contno=(select contno from dual);
虚拟表dual没有contno字段,单独执行select contno from dual报错,可以整个语句执行就是查询的所有的结果,相当于条件是1=1
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- php PDO::FETCH_ASSOC doesnt detect select after ba
- Bulk update SQL Server C#
因为这个字段是dbcontinfo的字段,子查询可以使用父查询用到的表。学习了
很简单啊,因为这个字段是dbcontinfo的字段,子查询可以使用父查询用到的表,你试试下面的SQL行不行?