searched_case.sql

来自「AbsDataBase5.16 最新版」· SQL 代码 · 共 13 行

SQL
13
字号
/*This SQL script uses Demos.abs database. 
  Please open ...\AbsoluteDatabase\Demos\Data\Demos.abs database file.
  This sample illustrates use of SEARCHED CASE construction.
  The query retrieves all events and notification whether it had happened already.*/

select e1."Event_Name", 
  case 
    when e1."Event_Date" < now then "In the past" 
    when e1."Event_Date" > now then "In the future" 
    else "Right now" 
  end as "When"
  from "events" e1

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?