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.
在我的表格中,我手动查看并发现前三个空闲单元已空闲 17、13 和 13 天。当我使用此 SQL 语句尝试提取空闲列值最高的三行时,我没有得到这些数字,我得到 8、7 和 7。我应该使用其他命令来获取前 3 行吗排序的结果集?
SELECT * FROM reporttables.idlereport WHERE LEFT(depot,3)='Roc' ORDER BY idle DESC LIMIT 3
谁能帮我弄清楚这句话有什么问题
'idle' 字段是数字还是 char 数据类型?
您找到的排序顺序建议 char,然后“7”可能“大于”“17”。
然后,您可能可以使用某种 CONVERT 转换 char 数据。确切的语法取决于您的 RDBMS 类型。