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.
我试图在一个数组中获取表的 max(id) 以及表内的所有值。我正在尝试的任何事情都会让我获得 max(id) 行的详细信息,但我正在一个查询中查找整个表。
mysql:
SELECT *, MAX(id) FROM table1 ORDER BY name ASC;
提前致谢
你可以试试,
SELECT *, (Select MAX(id) from table1) FROM table1 ORDER BY name ASC;