SQL语句之父子分类关系的查询
摘要:
例子如下图: 查询出来的结果多加一列,这一列的值为,当icode_ind有子分类,则该列的值为1,否则为0。是否有子类,看一下那表就很明显我的规则了。 实现的SQL语句: 1.Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->select a.iCode_ind,a.icode,case when b.iCode_ind is null then 0 else 1 endfrom TabA a outer apply (select top 1 阅读全文
posted @ 2010-08-02 09:54 汤尼 阅读(489) 评论(0) 推荐(0)

浙公网安备 33010602011771号