Someone gave me how to write oracle. I’m not familiar with oracle, please translate it
SELECT a.union_id, COUNT(*), COUNT(isMoreEndtime) --这是大于的,小于的拿count减下就可以了 FROM a, (SELECT b.union_id, decode(b.endtime, 1, 0) isMoreEndtime --自己去时间比较下,大于的标1,小的就0 FROM b WHERE b.union_id = 'xx') bb WHERE a.union_id = bb.union_id(+) AND a.union_id = 'xx' GROUP BY a.union_id
Someone gave me how to write oracle. I’m not familiar with oracle, please translate it