日期:2014-05-19  浏览次数:20772 次

SQL 语句问题求帮助
SELECT *, DATEDIFF(dd, flow_list_adddate, GETDATE()) AS difftime FROM (SELECT * FROM view_transferor_flow WHERE (bdId IN (SELECT bbid FROM (SELECT flProduct AS bbid, MAX(flFlow_Type) AS max FROM (SELECT * FROM flow_list WHERE (flFlow_Type < 8 )OR(flFlow_Type >= 20)) AS derivedtbl_2 GROUP BY flProduct) AS derivedtbl_1 WHERE (max = 2)))) AS atmp WHERE (flFlow_Type < 8 ) AND (ftOrder = 2)OR(flFlow_Type >= 20) AND projectId LIKE '%NAEEG2012200437%' and bName LIKE '%李海东%' ORDER BY flow_list_adddate DESC

这个语句用模糊查询为什么不好使 它查出来的是表里的所有数据 求解决

------解决方案--------------------
这语句写的看明白都要半天
------解决方案--------------------
先简单介绍下你的表的关系,以及你企图干啥。

如果能的话最好简单格式化下SQL,然后用编辑框上面有个“插入源代码”,选SQL,代码写在中间。
------解决方案--------------------
1、没有表结构
2、具体字段也不知道是哪个表的
。。。