Discussion:
SQL/MP - ERROR from SQL [-3074]
(too old to reply)
Gustavo Bertazzoli
2022-07-05 06:54:31 UTC
Permalink
Hi guys,

It's my first message here but I hope that someone can help me.

I'm doing a simple SQL with count, but I'm always getting an error and I don't know why.

Here is the query:
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6), DEFAULT)
group by sequenceGroup
browse access;

here is the error:
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is specified.

I didn't specified as ALL but maybe I don't. Can someone please help me?
Henrik Paludan-Moerk
2022-07-05 11:53:54 UTC
Permalink
please try to puy Select Count (*)
instead of count(id)? your sql looks fine to me.

//Henrik P
Post by Gustavo Bertazzoli
Hi guys,
It's my first message here but I hope that someone can help me.
I'm doing a simple SQL with count, but I'm always getting an error and I don't know why.
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6), DEFAULT)
group by sequenceGroup
browse access;
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is specified.
I didn't specified as ALL but maybe I don't. Can someone please help me?
Randall
2022-07-05 15:01:04 UTC
Permalink
Post by Henrik Paludan-Moerk
please try to puy Select Count (*)
instead of count(id)? your sql looks fine to me.
//Henrik P
Post by Gustavo Bertazzoli
Hi guys,
It's my first message here but I hope that someone can help me.
I'm doing a simple SQL with count, but I'm always getting an error and I don't know why.
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6), DEFAULT)
group by sequenceGroup
browse access;
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is specified.
I didn't specified as ALL but maybe I don't. Can someone please help me?
What are you trying to do? Count the number of unique IDs? Count the instances of each unique ID? Count the number of matching records?
Gustavo Bertazzoli
2022-07-08 08:37:15 UTC
Permalink
Post by Randall
Post by Henrik Paludan-Moerk
please try to puy Select Count (*)
instead of count(id)? your sql looks fine to me.
//Henrik P
Post by Gustavo Bertazzoli
Hi guys,
It's my first message here but I hope that someone can help me.
I'm doing a simple SQL with count, but I'm always getting an error and I don't know why.
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6), DEFAULT)
group by sequenceGroup
browse access;
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is specified.
I didn't specified as ALL but maybe I don't. Can someone please help me?
What are you trying to do? Count the number of unique IDs? Count the instances of each unique ID? Count the number of matching records?
Hi guys,

yes, I'm trying to count the amount of IDs per sequenceGroup. But I already saw that I forgot the sequenceGroup in the select part.
Thanks for the fast answer colleagues. I actually in the end, extracted to excel and did my countings directly on excel.

Have a nice weekend!
JShepherd
2022-07-10 15:29:39 UTC
Permalink
Post by Gustavo Bertazzoli
Post by Randall
Post by Henrik Paludan-Moerk
please try to puy Select Count (*)
instead of count(id)? your sql looks fine to me.
//Henrik P
Post by Gustavo Bertazzoli
Hi guys,
It's my first message here but I hope that someone can help me.
I'm doing a simple SQL with count, but I'm always getting an error and
I d
Post by Gustavo Bertazzoli
on't know why.
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6),
DEFA
Post by Gustavo Bertazzoli
ULT)
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
group by sequenceGroup
browse access;
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is
specified
Post by Gustavo Bertazzoli
.
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
I didn't specified as ALL but maybe I don't. Can someone please help me?
What are you trying to do? Count the number of unique IDs? Count the
instances
Post by Gustavo Bertazzoli
of each unique ID? Count the number of matching records?
Hi guys,
yes, I'm trying to count the amount of IDs per sequenceGroup. But I already
saw
Post by Gustavo Bertazzoli
that I forgot the sequenceGroup in the select part.
Thanks for the fast answer colleagues. I actually in the end, extracted to
excel
Post by Gustavo Bertazzoli
and did my countings directly on excel.
Have a nice weekend!
maybe try

select count(distinct id) from table1
where <predicate>;
Randall
2022-07-10 20:26:34 UTC
Permalink
Post by Gustavo Bertazzoli
Post by Gustavo Bertazzoli
Post by Randall
Post by Henrik Paludan-Moerk
please try to puy Select Count (*)
instead of count(id)? your sql looks fine to me.
//Henrik P
Post by Gustavo Bertazzoli
Hi guys,
It's my first message here but I hope that someone can help me.
I'm doing a simple SQL with count, but I'm always getting an error and
I d
Post by Gustavo Bertazzoli
on't know why.
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
select
count(ID)
from table1
where
IDstate not in ("release", "finished")
and dateformat(TIMESTAMP year to FRACTION(6), DEFAULT) >
dateformat(DATETIME "2022-07-05:00:00:00.000000" year to FRACTION(6),
DEFA
Post by Gustavo Bertazzoli
ULT)
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
group by sequenceGroup
browse access;
...select count(ID) from table1...
^
*** ERROR from SQL [-3074]: You cannot specify COUNT when ALL is
specified
Post by Gustavo Bertazzoli
.
Post by Randall
Post by Henrik Paludan-Moerk
Post by Gustavo Bertazzoli
I didn't specified as ALL but maybe I don't. Can someone please help
me?
Post by Gustavo Bertazzoli
Post by Randall
What are you trying to do? Count the number of unique IDs? Count the
instances
Post by Gustavo Bertazzoli
of each unique ID? Count the number of matching records?
Hi guys,
yes, I'm trying to count the amount of IDs per sequenceGroup. But I already
saw
Post by Gustavo Bertazzoli
that I forgot the sequenceGroup in the select part.
Thanks for the fast answer colleagues. I actually in the end, extracted to
excel
Post by Gustavo Bertazzoli
and did my countings directly on excel.
Have a nice weekend!
maybe try
select count(distinct id) from table1
where <predicate>;
select id, count(1) from table1
where <predicate>
group by id;

Loading...