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.
我想按出发时间(增加)订购查询。我用:
$query = "SELECT station,hdeparture FROM train WHERE number = '".$id_train."' ORDER BY hdeparture";
但它似乎不起作用,因为没有订购。
怎么了?
谢谢你。
问题是您通过仅包含唯一值的字段过滤数据来将内容限制为单行。查询将返回 1 或 0 行,并且排序不会执行任何操作。
这是您修改的 SQLFiddle,您可以在其中按出发顺序查看行程。只有过滤器numero被删除。
numero
http://sqlfiddle.com/#!2/325bc/6