我想从同一帐号中选择最大客户id。
select max (customer_ID),account_number from Account group by account_number having account_number ='30010258'
结果是我希望结果是
30byixjq1#
选择max(int(customer\u id)),account\u number from account group by account\u number having account\u number='30010258'
col17t5w2#
使用 where 从句代替 having .注意:如果account\u number是int类型,则删除30010258周围的引号。如果customer\u id的数据类型是string,则必须将其转换为int。
where
having
select max (customer_ID),account_number from Account where account_number ='30010258' group by account_number
2条答案
按热度按时间30byixjq1#
选择max(int(customer\u id)),account\u number from account group by account\u number having account\u number='30010258'
col17t5w2#
使用
where
从句代替having
.注意:如果account\u number是int类型,则删除30010258周围的引号。如果customer\u id的数据类型是string,则必须将其转换为int。