Translate this MySQL query to PyGreSQL

后端 未结 1 1952
无人共我
无人共我 2021-01-16 11:25

I\'m working on a Ruby app which uses the mysql functions XOR (^) and BIT_COUNT(). However I now need to run the app on Heroku, which runs PyGreSQL.

I can\'t find an

相关标签:
1条回答
  • 2021-01-16 11:55
    SELECT  *
    FROM    photos
    WHERE   (
            SELECT  SUM(((phash::bigint # 2061756291569501157) >> bit) & 1)
            FROM    generate_series(0, 63) bit
            ) <= 15
    
    0 讨论(0)
提交回复
热议问题