Subject | Re: [ib-support] join-sort question |
---|---|
Author | Svein Erling Tysvær |
Post date | 2001-07-03T15:49:02Z |
>i did try the 'order by patients.name' (and p.name) and both situationsBy the way, I think I can guess why it doesn't let you use order by name
>report no column of this name, so no fix yet!
successfully. The order by refers to the result set, and you cannot have
two fields with the same name. When it chooses the wrong one to be named
NAME, the other one gets a different name. Maybe
select p.unique_id, p.name as sortname, s.additional_info, s.name
from patients p
left outer join patientstatus s on (p.unique_id=s.unique_id)
order by sortname
or
select p.unique_id, p.name as sortname, s.additional_info
from patients p
left outer join patientstatus s on (p.unique_id=s.unique_id)
order by name
will work? (the second option simply avoids selecting the name from
patientstatus)
Set