【问题标题】:What does '?' mean in the context of a Query in Springboot什么是'?在 Spring Boot 中的查询上下文中的意思
【发布时间】:2022-01-12 10:45:15
【问题描述】:
SELECT Students 
FROM department 
WHERE department.id=?1

这个查询中的 ?1 到底是什么?

提前致谢!!!!

【问题讨论】:

  • 查找参数占位符。

标签: mysql sql database


【解决方案1】:

问号 ( ? ) 用作占位符。 与 1 一起使用意味着它应该看起来像这样:

variable + "1" 得到 "variable1" 的串联

例如:如果占位符变量为“5”,您将拥有: "Select Students from department where department.id=51"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-14
    • 2021-07-16
    • 2022-01-23
    • 2011-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多