SELECT a.*, 1 DELETABLE, '' YEAR_ON, '' MONTH_ON, TOOL_STATUS status0 FROM TOOL a

说明:其中tool字段有tool_status字段。

问题:1 deleteable, '' year_on 这些新取的字段是什么意思?

答:tool表中没有deleteable,year_on字段,页面上又需要这些字段,所以在可以在查询表中使用 1 deleteable, '' year_on 查询出一个新的列,其中列的值为1 或者 '',也就是新列名的前一个字符串。

问题2: select a.*, tool_status status0 from tool a 中status0是什么意思?

答: a.* 表示所有的字段,都可以取出,而tool_status status0表示取别名,查询出来的数据中列名包括a的所有字段,还包括status0。并不是只有satus0,而把tool_status列去了。

 

相关文章:

  • 2021-07-21
  • 2022-12-23
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
相关资源
相似解决方案