我需要从col1_class列中查找Count的最大值,并更新table2列' lbl1'有价值的 我尝试了这段代码,但是我收到了错误:
update testClassLable
set lbl1 = (
select max(maxVal)
from (
select count (col1_class) as maxVal
from tbl_test_all
group by col1_class
)x
)
你可以帮忙吗?
*更新*
我现在编辑了上面的代码及其工作,但它返回:
0行受影响!
答案 0 :(得分:1)
试试这个
update testClassLable
set lbl1 = (
select max(countVal)
from (
select count(col1_class) as countVal
from tbl_test_all
group by col1_class
) x
)