mysql> use hive;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> UPDATE hive.SDS SET CD_ID= (
->
-> SELECT CD_ID FROM hive.SDS WHERE
-> LOCATION='hdfs://master:8020/user/hive/warehouse/pretmp.db/total_234g_gn_table_cellhost'
->
-> ) WHERE LOCATION LIKE
-> 'hdfs://master:8020/user/hive/warehouse/pretmp.db/total_234g_gn_table_cellhost/day=20160725%'
-> ;
ERROR 1093 (HY000): You can't specify target table 'SDS' for update in FROM clause
mysql>
--修改后
mysql>
mysql> UPDATE hive.SDS SET CD_ID= (
-> SELECT cd_id FROM (
-> SELECT CD_ID FROM hive.SDS WHERE
-> LOCATION='hdfs://master:8020/user/hive/warehouse/pretmp.db/total_234g_gn_table_cellhost'
-> ) a
-> ) WHERE LOCATION LIKE
-> 'hdfs://master:8020/user/hive/warehouse/pretmp.db/total_234g_gn_table_cellhost/day=20160725%';
Query OK, 0 rows affected (0.01 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql>