Subject | RE: [IBO] Remove member of "Select" set from result set |
---|---|
Author | Svein Erling Tysvær |
Post date | 2012-08-09T18:12:18Z |
>Here is my sql:Simply omit the field from your select list, I think it works fine with simple selects like yours:
>
> select
> ResFirst, Reslast, '<a href="mailto:'||eMail||'">'||ResLast||'</a>' as eLast,
> Nickname, Bldg, Unit, Cell, Landline, Birthday from Residents
> Order by ResLast, ResFirst
>
><...> is html to include link to the person's email address.
>
>Works fine, but I want to omit ResLast from the result set.
>
>eLast also contains the last name. I cannot sort on that because the entire string is sorted,
>not just the last name, which is the desired sorting.
>
>Any ideas?
select
ResFirst, '<a href="mailto:'||eMail||'">'||ResLast||'</a>' as eLast,
Nickname, Bldg, Unit, Cell, Landline, Birthday from Residents
Order by ResLast, ResFirst
Maybe (I don't know for sure) more complex selects will complain, if so, I'd recommend including the field (or expression) you want to sort by in a CTE and then just select all the fields you're interested in from the CTE, omit the "ordering field" and use it purely for ordering.
I'd say this question (or at least my answer) is more appropriate for the firebird-support list than here on the IBO list.
HTH,
Set