Hi!
I have been trying to add one state trasition in the CRM, but I always
get an error saying: Database operation "1row" failed (exception NSDB,
"Query was not a statement returning rows.")
the addition to state transition is this:
user_id = (select creation_user from chat_msgs where
to_char(creation_date, 'HH24:MI:SS') > '10:30:00' and
to_char(creation_date, 'HH24:MI:SS') < '14:30:00' group by
creation_user having count(creation_user) > 10)
if I do this directly from psql:
update users
set crm_state = 'one state', crm_state_entered_date = sysdate()
where crm_state = 'other state'
and (
user_id = (select creation_user from chat_msgs where
to_char(creation_date, 'HH24:MI:SS') > '10:30:00' and
to_char(creation_date, 'HH24:MI:SS') < '14:30:00' group by
creation_user having count(creation_user) > 1)
);
I got this message:
ERROR: More than one tuple returned by a subselect used as an
expression.
What could be wrong??
Thank you for the help!