我正在摆弄创建子查询只是为了习惯它们。如果某人的 ID 在联结表中出现 X 次,我正在尝试获取一个人的 ID# 和相关费用。我试过了
select id, charges from myTable
where id in
(
select id from jxnTable
having (count(jxn.id> 10))
group by jxn.id
这给了我错误jxn.id is invalid in the select list because it is not contained in either an aggregate function of a group by clause.