我有一个包含以下架构的表:
people_stages
id | person_id | stage_id | created
1 | 1 | 1 | 2013-09-01 00:00:00
2 | 1 | 2 | 2013-09-02 00:00:00
3 | 1 | 3 | 2013-09-03 00:00:00
Run Code Online (Sandbox Code Playgroud)
我创建了以下查询以选择按人员分组的最新阶段:
SELECT *
FROM people Person
LEFT JOIN people_stages PersonStage ON PersonStage.person_id = Person.id
WHERE PersonStage.created = (SELECT MAX(people_stages.created) FROM people_stages GROUP BY person_id HAVING person_id = PersonStage.person_id);
Run Code Online (Sandbox Code Playgroud)
但是,如果我尝试在Person表中按ORDER BY字段,它工作正常:
SELECT *
FROM people Person
LEFT JOIN people_stages PersonStage ON PersonStage.person_id = Person.id
WHERE PersonStage.created = (SELECT …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装PECL包,我收到了这个错误.我不确定该怎么办,所以希望有人可以提供一些帮助:
# pecl install -f ssh2
WARNING: failed to download pecl.php.net/ssh2 within preferred state "stable", will instead download version 0.11.3, stability "beta"
downloading ssh2-0.11.3.tgz ...
Starting to download ssh2-0.11.3.tgz (23,062 bytes)
........done: 23,062 bytes
5 source files, building
running: phpize
Cannot find build files at '/usr/lib64/php/build'. Please check your PHP installation.
ERROR: `phpize' failed
Run Code Online (Sandbox Code Playgroud)