the "having" clause

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: toylet (toylet_at_mail.hongkong.com)
Date: 03/08/04


Date: Mon, 08 Mar 2004 17:54:57 +0800

Why did SQL Server complain about "invalid column recno" in the
following query? It worked in another database tool I am using.

select xx.pk, xx.amount, count(*) as recno
from tx xx, tx yy
where xx.pk>=yy.pk
group by xx.pk, xx.amount
having recno = 1

-- 
   .~.    Might, Courage, Vision. In Linux We Trust.
  / v \   http://www.linux-sxs.org
/( _ )\  Linux 2.4.22-xfs
   ^ ^    5:52pm up 2 days 2:02 load average: 0.99 0.97 0.96


Relevant Pages

  • Re: multiple tables in one query
    ... subforms would probably be in order. ... > by changing the Recordset to Dynaset(Inconsistent ... If I try to put in the RecNo. ... >>result in a non updateable query. ...
    (microsoft.public.access.queries)
  • Error in New Query Wizard in Server Explorer using OLEDB provider
    ... Whenever I try to create a query involving an outer join and execute SQL with ... Recno integer, Type integer. ... Microsoft OLE DB Provider for Visual FoxPro ...
    (microsoft.public.vsnet.ide)
  • Re: the "having" clause
    ... That other database tool doesn't follow the ANSI SQL standard. ... evaluation order is why you can only refer to a column alias in the ORDER BY ... SELECT ..., recno ... a query that he regularly posts here. ...
    (microsoft.public.sqlserver.programming)
  • Re: Number of Records
    ... > - a Tcursor, go to the end of the table and use RecNo() ... effective index. ... Don't do a query, because that would cause the computer to consider every ...
    (comp.databases.paradox)
  • Re: the "having" clause
    ... toylet wrote: ... > following query? ... It worked in another database tool I am using. ... > select xx.pk, xx.amount, countas recno ...
    (microsoft.public.sqlserver.programming)