Home > database >  Mysql to find out a number from the table, and then insert a new record
Mysql to find out a number from the table, and then insert a new record

Time:09-20



INSERT INTO ` t_dict ` (` dict_code `, ` dict_name `, ` dict_key `, ` dict_value `, ` dict_sort `, ` enable `, ` parent `, ` remark `) VALUES (' SCORE5 ', '5 star', 'SCORE506', 'next time use', 6, '1', 426, NULL);


Select the id from t_dict where dict_code="PRODUCT_TYPE" AND dict_key="0404";

I want to put the first statement in 426 and the second statement query out the results of the binding,

CodePudding user response:

Bosses help, online, etc.,,,

CodePudding user response:

Like this? The query the parent ID of each other's record
E.g.
 select * 
The from t_dict as a
Left the join t_dict as b on Amy polumbo arent=b.I D
Where a. d. ict_code="PRODUCT_TYPE" AND a. d. ict_key="0404";

CodePudding user response:

What is the meaning of "binding"?
  • Related