我正在运行以下命令:
#standardSQL
UPDATE `speedy-emissary-167213.pgp_orielresearch.pgp_PIK3CA_all_features_values_step_5` AS t2
SET
chr3_3308581_TGGGGT=IF(t1.PIK3CA_features="chr3_3308581_TGGGGT",1,0),
chr3_3294651_CA=IF(t1.PIK3CA_features="chr3_3294651_CA",1,0),
chr3_3300867_CC=IF(t1.PIK3CA_features="chr3_3300867_CC",1,0),
chr3_3308373_ACTTGACTTG=IF(t1.PIK3CA_features="chr3_3308373_ACTTGACTTG",1,0),
chr3_3309125__T=IF(t1.PIK3CA_features="chr3_3309125__T",1,0),
......
chr3_3300985_TT=IF(t1.PIK3CA_features="chr3_3300985_TT",1,0),
chr3_3308139_AC=IF(t1.PIK3CA_features="chr3_3308139_AC",1,0)
FROM
`speedy-emissary-167213.pgp_orielresearch.pgp_PIK3CA_all_features_values_step_4_sorted_500` AS t1
WHERE
t1.sample_id = t2.sample_id
当我用500“chr3_3308581_TGGGGT = IF(t1.PIK3CA_features =”chr3_3308581_TGGGGT“,1,0)运行它时,”对于不同的列,Scalar子查询产生了多个元素被触发。当我使用less命令(通过删除部分命令)运行它时,命令成功运行。调试此查询的最简单方法是什么?
谢谢!
答案 0 :(得分:2)
在where子句中缺少另一个条件。这工作
#standardSQL
UPDATE
`speedy-emissary-167213.pgp_orielresearch.pgp_PIK3CA_all_features_values_step_5` AS t2
SET
chr3_3294687_A = 1
FROM
`speedy-emissary-167213.pgp_orielresearch.pgp_PIK3CA_all_features_values_step_4_sorted_500` AS t1
WHERE
t1.sample_id = t2.sample_id and t1.PIK3CA_features="chr3_3294687_A"