zoukankan      html  css  js  c++  java
  • oracle积累继续

    选出当天的日期的数据

    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;

  • 相关阅读:
    JQuery
    Ubuntu18.04
    Ubuntu18.04
    Ubuntu18.04
    Ubuntu18.04
    Cordova
    Android
    Android
    Delphi
    postgresql之 drop & delete & truncate
  • 原文地址:https://www.cnblogs.com/unixshell/p/3299065.html
Copyright © 2011-2022 走看看