加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

postgresql(2)

发布时间:2020-12-13 17:08:25 所属栏目:百科 来源:网络整理
导读:mysql转换postgresql 1)时间格式转换 from_unixtime(timestamp,'%Y-%m-%d' ) ==》 SELECT to_char(to_timestamp(t.create_time / 1000),'YYYY-MM-DD HH24:MI:SS') 2)字段拼接GROUP_CONCAT(restaurantid,'|',cityid) ==》 select array_to_string(ARRAY(SEL

mysql转换postgresql

1)时间格式转换from_unixtime(timestamp,'%Y-%m-%d' ) ==》

SELECT to_char(to_timestamp(t.create_time / 1000),'YYYY-MM-DD HH24:MI:SS')

2)字段拼接GROUP_CONCAT(restaurantid,'|',cityid) ==》

select array_to_string(ARRAY(SELECT unnest(array_agg(restaurantid))),(SELECT unnest(array_agg(cityid))))

3)SELECT GROUP_CONCAT(cityid) ==》SELECT CONCAT(cityid)

4)字段含大写字母的需要加引号

5)`符号不支持

6)postgresql对类型比较敏感,不同类型不能直接做比较

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读