Insert into Fangan1 (rated performance, position level, the commission scheme number, category, store category coding, basic salary) values (isnull (' ', 0), the 'trainer', 4, 1, '101', '333') I want to make the rated performance and then give him a 0 is empty, but now it won't assign 0 is how to return a responsibility
CodePudding user response:
Values (isnull ('
', 0), the 'trainer', 4, 1, '101', '333')
Note the use of the isnull
CodePudding user response:
reference 1st floor hulusi1103 response: values (isnull (' ', 0), the 'trainer', 4, 1, '101', '333') Note the use of the isnull Wrote complains, 'rated performance of value is the need to provide, let isnull how to judge? Feel good logic of the building Lord, since this is the insert statement, insert 0 no directly? Insert into Fangan1 (rated performance, position level, the commission scheme number, category, store category coding, basic salary) values (0, 'trainers', 4, 1,' 101 ', '333') Unless it is operated on the original data in the table, such as performance rating is null record of all the update once The update Fangan1 set performance rating=0 where performance rating is null CodePudding user response:
Values (isnull (' performance rating, 0), the 'trainer', 4, 1, '101', '333') Note the use of the isnull Isnull (' ', 0) judgment is empty, can't judge, the assignment is 0, cannot be carried out, Values (isnull (' judgment method, 0), the 'trainer', 4, 1, '101', '333') Note that the judgment method return value must be a Boolean type CodePudding user response:
Grammar, should use the mysql database, try this, Insert into Fangan1 (rated performance, position level, the commission scheme number, category, store category coding, basic salary) The select ifnull (? , 0), the 'trainer', 4, 1, '101', '333' the from dual; The above question, give you the value of the rated performance if this value is not null, just write the actual value, or write to 0,