Subject RE: [firebird-support] order by subselected value
Author Alan McDonald
> Hi to all,
>
> I have got a little problem with this query:
> SELECT
> n.*, (n.datefinish-CURRENT_TIMESTAMP)*{DAY} rest, n.article,
> n.idealprice, c.name,
> (SELECT COUNT(*) FROM offers o WHERE o.nbid=n.id) offers
> FROM need n, category c
> WHERE
> c.id=n.catid AND c.isactive=1 AND n.userid=? AND
> CURRENT_TIMESTAMP>=n.datestart
> AND CURRENT_TIMESTAMP<=n.datefinish
> ORDER BY offers;
>
> and getting Dynamic SQL Error SQL error code = -206 Column unknown OFFERS.
> Is it possible to %subj%?
>
> thanx
> Michal

use the column number instead
Alan