Check if a temporary table exists and delete if it exists before creating a temporary table

前端 未结 15 739
忘掉有多难
忘掉有多难 2020-11-29 14:13

I am using the following code to check if the temporary table exists and drop the table if it exists before creating again. It works fine as long as I don\'t change the colu

15条回答
  •  迷失自我
    2020-11-29 15:01

    When you change a column in a temp table, you must drop the table before running the query again. (Yes, it is annoying. Just what you have to do.)

    I have always assumed this is because the "invalid column" check is done by parser before the query is run, so it is based on the columns in the table before it is dropped..... and that is what pnbs also said.

提交回复
热议问题