[EMAIL PROTECTED] schrieb am 24.02.02:
hi robert,
a short look into C.J.Date with Hugh Darwen "The SQL standard" 4th ed.
(handy to have around) shows me:
aggregate-function-reference
::= COUNT(*)
| { AVG | MAX | MIN | SUM | COUNT } ( [ ALL | DISTINCT ] scalar-expression )
so you cannot use a "table constructor" (?) in place of a count scalar expression.
Instead the following should work:
select count(*) from (select distinct per_lastname, per_firstname from person)
also possible but not working with SAPDB (as it lacks subqueries of that form):
select count( (select distinct per_lastname, per_firstname from person) ) from dual
regards
Wolf N�cker
Robert Kr�ger <[EMAIL PROTECTED]> schrieb am 24.02.02:
> hi all,
>
> this is a little embarassing as i suspect the answer might be
> non-sapdb-specific and a standard SQL-problem, however it's driving me nuts
> and looking at the reference manual didn't help either.
>
> ok, this works:
>
> select count(distinct per_lastname) from person
> or
> select distinct per_lastname, per_firstname from person
>
> but why doesn't this work?
>
> select count(distinct per_lastname, per_firstname) from person
>
> I get a SQL -5016 Missing Delimiter. could someone please enlighten me with
> the correct syntax to count the number of results of a distinct expression
> that applies to more than one column?
>
> thanks in advance,
>
> robert
>
> _______________________________________________
> sapdb.general mailing list
> [EMAIL PROTECTED]
> http://listserv.sap.com/mailman/listinfo/sapdb.general
______________________________________________________________________________
Tagesgeld: 4% Guthabenzinsen bei t�glicher Verf�gbarkeit. Jetzt informieren!
http://diba.web.de/
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general