【sql】比较两列数据

select testcode,testvalue,procode,provalue,testresult from (select test.PARAM_NAME testcode, test.result testresult, test.PARAM_VALUE testvalue,pro.param_name procode,pro.param_value provalue


from `xixi`.`t_common_global_param` test, `xixi_backup`.`t_common_global_param` pro


where test.PARAM_NAME= pro.PARAM_NAME) haha


 where testvalue in (select provalue from (select test.PARAM_NAME testcode, test.PARAM_VALUE testvalue,pro.param_name procode,pro.param_value provalue


from `xixi`.`t_common_global_param` test, `xixi_backup`.`t_common_global_param` pro


where test.PARAM_NAME= pro.PARAM_NAME) haha where provalue is not null)

猜你喜欢

转载自blog.csdn.net/shiki_41/article/details/80832318
今日推荐