• sql 的积累


    sql的积累 By:山高似水深 原创 转载注明出处

    1、REVERSE()  反转  
    例如:124.205.58.30  结果03.85.502.421
    Hive 可用

    2016年12月3日11:31:59
    2、instr(str,'.')位置
    结果:得出在str中第一个'.' 的位置
    hive可用

    2016年12月3日11:32:04

    3、substr(str,1,2)截取
    结果:得出从str的开始截取,截取到第二位
    hive可用

    2016年12月3日11:32:07

    4、
    substring_index(str,'.',3)截取
    结果:从str的开始截取,截取到第三个'.'的位置
    hive不可用 mysql可用

    2016年12月3日11:32:11

    5、

    insert into table city_rank select city,num,company from
    (select city,count(distinct listings1)as num,company from salehouse where date='201609' and city is not null and length(city)>1 and length(city)<4 and company <> '独立经纪人' and length(company)>2 and length(company)<8 and length(listings1)>7 and length(listings1)<16 group by city,company order by city asc,num desc) order_num
    where row_number(city) <= 5;

    By:山高似水深
  • 相关阅读:
    1265 四点共面
    1003 阶乘后面0的数量
    1080 两个数的平方和
    1090 3个数和为0
    1087 1 10 100 1000
    1082 与7无关的数
    OpenLayers工作原理
    CI(持续集成)CD(持续交付)
    打包命令
    文件与目录管理重点
  • 原文地址:https://www.cnblogs.com/tnsay/p/6133291.html
Copyright © 2020-2023  润新知