0

我希望能够从数据库的内部选择中订购列表。我的代码:

$sql = "SELECT * from `users` WHERE `name` in (select `last` from info where `date` = '2013' ORDER BY  `id` DESC)";

我希望能够从 tablelast而不是users.

4

1 回答 1

1

尝试这个,

使用JOIN查询

$sql = "SELECT u.* from `users` u JOIN `info` i ON u.name = i.last WHERE i.date = '2013' ORDER BY i.id DESC";
于 2013-06-28T03:26:50.807 回答