sb = new StringBuffer("SELECT a.* ");
sb.append(" FROM Table_A a ");
sb.append(" LEFT JOIN B b ON a.CLJCRLSH = b.CLJCRLSH and a.jccs =b.jccs ");
sb.append(" where ");
sb.append(" ((b.CLJCRLSH IS NULL and b.jccs is null) or (b.CLJCRLSH =a.CLJCRLSH and b.jccs !=a.jccs)) ");
if (orders != null) {
sb.append(orders);
}
sb.append(" order by a.JCKSSJ desc ");
SqlServer 查B表中不含A表中的数据
最新推荐文章于 2023-09-01 11:09:19 发布