zoukankan      html  css  js  c++  java
  • postgresql jsonb类型查询

    select * from (select * from ud_order where user_id=10 and status=2
    union
    select * from ud_order where user_id=0 and status=2 and order_info->'orderContact'->>'email' = '222@163.com') a where 1=1


    select * from ud_order where (user_id=10 and status=2) or (user_id=0 and status=2 and order_info->'orderContact'->>'email' = '222@163.com') order by order_date desc limit 20 offset 0


    select * from ud_order where (user_id=10 and status=2 and order_desc like '%t%') or (user_id=0 and status=2 and order_info->'orderContact'->>'email' = '222@163.com' and order_desc like '%t%')

    order_info 是jsonb类型

    参考地址:http://www.linuxidc.com/Linux/2013-12/94354.htm

    查看资料:http://www.cnblogs.com/mywebnumber/p/5551092.html

  • 相关阅读:
    校验参考相关备份
    API接口设计
    redis 基础配置
    Apollo 统一配置中心
    http返回状态码记录
    ngnix实战
    OAuth2三方授权
    OAuth2授权协议记录
    KMP算法
    分治法
  • 原文地址:https://www.cnblogs.com/qyhol/p/5461906.html
Copyright © 2011-2022 走看看