select * from pub_billtemplet where BILL_TEMPLETCAPTION like'%采购合同%' and pk_billtypecode ='Z2'
select * from pub_billtemplet_b where pk_billtemplet='xxx'
select * from pub_billtemplet_b where METAdataproperty='ct.ct_pu.vdef24_301' select * from pub_billtemplet where BILL_TEMPLETCAPTION like'%采购合同%' and pk_billtypecode ='Z2' and PK_BILLTEMPLET not in ( select head.pk_billtemplet from pub_billtemplet head LEFT JOIN pub_billtemplet_b b on head.pk_billtemplet=b.pk_billtemplet where head.BILL_TEMPLETCAPTION like'%采购合同%' and head.pk_billtypecode ='Z2' and b.METAdataproperty='ct.ct_pu.vdef24_301' )