我对谷歌或 SO 搜索没有任何运气,所以就这样吧。
我尝试对 HSQLDB 2.3.0 运行以下 SQL 语句。
select
tr.id as training_request_id,
s.id as student_id,
s.first_name as student_first_name,
s.last_name as student_last_name,
s.title as student_title,
c.id as customer_id,
c.name as customer_name,
trs.status
from training_request tr
left outer join student s on tr.student_id = s.id
left outer join customer c on tr.customer_id = c.id
left outer join training_request_status trs on tr.id = trs.training_request_id
where tr.slot_id is not null
order by tr.id, trs.date_entered DESC
返回时,列是:ID、ID、FIRST_NAME、LAST_NAME、TITLE、ID、NAME、STATUS
为什么 AS 关键字没有任何作用?
更新:这是 SQuirreL 的截图。引用 student_id 列无效。