示例:

如果该表名为t,并且列名为col_name和col_sex,并且为col_name输入的字符串为string_value,那么您需要的是:

insert into t (col_came, col_sex) values (string_value, 
                                case when string_value like '%a' then 'F' else 'M' end);

相关文章:

  • 2022-01-27
  • 2022-12-23
  • 2021-07-28
  • 2021-12-24
  • 2022-12-23
  • 2021-09-23
  • 2021-08-27
猜你喜欢
  • 2022-01-13
  • 2021-10-20
  • 2021-06-06
相关资源
相似解决方案