选出当天的日期的数据

select * from test_table where to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd');

 

要想改变查询的结果,可以用 (case when then else end) as 句式

select (case when to_char(datetime, 'yyyy-mm-dd')=to_char(sysdate,'yyyy-mm-dd') then '今日' else '非今日' end) as datetime, shengfu from test_table;

 

repalce用法

replace(c1, c2, c3)

从c1字符串中找到c2字符,替换成c3字符

 

lpad用法

lpad(c1, length, c3)

返回没有length长,用c3再左边补齐

比length长,从右边截断

 

选两张表,结合

select t1.sname||'_VS_'||t2.sname from qiudui t1, qiudui t2 where t1.sname<>t2.sname;

 

 

 

 

 

 

 

 

 

相关文章:

  • 2021-09-20
  • 2021-05-30
  • 2022-02-23
  • 2021-06-14
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-20
  • 2021-08-01
  • 2021-10-08
  • 2022-12-23
  • 2021-10-01
  • 2021-08-21
  • 2021-11-26
相关资源
相似解决方案