Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 2 张桌子:公寓楼
每个公寓都有 building_id
公寓有“地板”列,其中存储公寓楼层。每个建筑物都有“totalFloors”列,其中存储总楼层(例如,当前公寓是 3 of 9 floor)
我需要过滤像“公寓楼层不是最后一层”这样的公寓。
我怎样才能做到这一点?
我正在使用 SphinxQL。
从评论中复制,但是
SELECT *,totalFloors - floor AS filter FROM index WHERE filter > 0;
应该这样做:)