0

我对谷歌或 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 列无效。 在此处输入图像描述

4

1 回答 1

1

弄清楚了。

有一个名为“get_column_name”的连接属性。将其设置为假。默认值为真。

http://hsqldb.org/doc/2.0/guide/dbproperties-chapt.html jdbc:hsqldb:hsql://localhost/enrolments;get_column_name=false

于 2013-08-09T14:28:07.467 回答