V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
fancy2020

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

  •  
  •   fancy2020 · May 19, 2020 · 3626 views
    This topic created in 2182 days ago, the information mentioned may be changed or developed.
    1 replies    2020-05-19 08:08:11 +08:00
    raquelken
        1
    raquelken  
       May 19, 2020
    order by array_position(array[5, 4, 2, 3]::integer[], target_table.integer_id)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3032 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 04:51 · PVG 12:51 · LAX 21:51 · JFK 00:51
    ♥ Do have faith in what you're doing.