Same SQL runs fast in QUERY but very slowly in SP?
问题 I had tried to add or remove the '@' before variables or params but nothing happened. QUERY start transaction; set @recordClient = (select ClientId from by_test_db1.recordcd where SN = 'abc' ); set @logClient = (select ClientId from by_test_db1.log where SN = 'abc' ); select concat(@recordClient,@logClient); commit; SP delimiter $$ create procedure TEST(newSN varchar(50)) begin start transaction; set @recordClient = (select ClientId from by_test_db1.recordcd where SN = newSN ); set @logClient