好的sql
2017-01-07 10:51
471 查看
select count(2)
from vw_pmcthtdj A
WHERE a.HTBL_ID not in (select jg.jgjs_htid
from PMCTJGJS jg
where jg.JGJS_SFXX = '1'
and jg.jgjs_spzt = '11'
and jg.jgjs_htid = a.HTBL_ID) /*and len(HTBL_TBDWMC)>0*/
and (a.LSXM is null or a.LSXM <> '1') and htbl_tbdwmc like '上海市政建设有限公司%' and htbl_yjjgrq is null
from vw_pmcthtdj A
WHERE a.HTBL_ID not in (select jg.jgjs_htid
from PMCTJGJS jg
where jg.JGJS_SFXX = '1'
and jg.jgjs_spzt = '11'
and jg.jgjs_htid = a.HTBL_ID) /*and len(HTBL_TBDWMC)>0*/
and (a.LSXM is null or a.LSXM <> '1') and htbl_tbdwmc like '上海市政建设有限公司%' and htbl_yjjgrq is null
相关文章推荐
- ORACLE列转行示例
- java连接MySQL数据库DB类底层框架代码实现
- MySQL
- MySQL存储过程(转)
- 【Mysql】 局域网远程连接问题
- memcached在项目中的应用
- Memcached 基本配置
- MySQL详解--锁
- 使用sql语句,根据年月日得到日期列
- mysql 性能剖析
- SQL 第一范式、第二范式、第三范式、BCNF
- redis基本使用
- python操作redis
- SQL Server中数据库文件的存放方式,文件和文件组
- redis常用命令
- MySQL的btree索引和hash索引的区别
- 抓报错SQL
- Mybatis核心杂谈
- 本地数据库加密框架SQLciper
- sql server中的 SET NOCOUNT ON 的含义