update字段中带select UPDATE tb_report_type A INNER JOIN (SELECT LEVEL_CODE FROM tb_report_type WHERE id = 'ED894BE001CE4F47A2916287A491B4E1') BSET A.LEVEL_CODE = CONCAT(B.LEVEL_CODE,'-',A.id) WHERE A.PARENT_ID = 'ED894BE001CE4F47A2916287A491B4E1'
mysql中判断字段为null或者不为null 在mysql中,查询某字段为空时,切记不可用 = null, 而是 is null,不为空则是 is not null select nulcolumn from table; if nuncolumn is null then select 1; else select 2; end if; 执行存储过程 调用过程:call sp_add (1,2,@a);select @a;