V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
fancy2020
V2EX  ›  PostgreSQL

PostgreSQL 中如何模拟 MySQL 的 order by FIELD()功能?

  •  
  •   fancy2020 · 2020-05-19 07:50:17 +08:00 · 2671 次点击
    这是一个创建于 1410 天前的主题,其中的信息可能已经有所发展或是发生改变。
    1 条回复    2020-05-19 08:08:11 +08:00
    raquelken
        1
    raquelken  
       2020-05-19 08:08:11 +08:00
    order by array_position(array[5, 4, 2, 3]::integer[], target_table.integer_id)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5165 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 09:30 · PVG 17:30 · LAX 02:30 · JFK 05:30
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.