原文地址:

https://www.cnblogs.com/poterliu/p/4925483.html

 

①如果插入字段包含对应的表的所有字段,并且是按照表中字段顺讯书写的,则可以用如下格式:

  String sql = "insert into tb_user values(?,?,?,?,?,?)";


②如果插入字段只是包含表中字段的一部分(不含全部),则必须书写成如下格式:

  String sql = "insert into tb_user set uid=?,username=?,password=?,email=?,code=?";

注意:在①的情况下可以用②的格式书写,但是在②的情况下则不能用①的格式书写。

 

相关文章:

  • 2021-07-04
  • 2021-12-28
  • 2021-08-01
  • 2021-11-12
  • 2021-11-20
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2022-01-02
  • 2022-01-19
相关资源
相似解决方案