一、有两列数据如下图,要求列出A列多出来的那个数字“1” ?
表数据:
#by 挠总
select k.a
from (select a, count(*) a_num from dfdf h group by a) k
left join
(select b, count(*) b_num from dfdf group by b) j on k.a = j.b
where k.a_num > j.b_num
二、mysql / kingbase 模糊查询json数据
#mysql写法
select * from "jsonTable" where info->'$.name' like '%张%'
#kingbase写法 参考:《金仓KingbaseES测试用例-通用版V6.0》
select * from "jsonTable" where info->>'name' like '%张%'
#题外话:存json, 选择用MongoDB