couldnt-execute-query-error-syntax-error-at-or-near-where-line-1

Questionscouldnt-execute-query-error-syntax-error-at-or-near-where-line-1
Zeead Tanjim asked 3 months ago

Hi!

I’m running a query using the select_command. The query is as following:

SELECT o_carrier, t_carrier, attempt_calls, connected_calls, attempt_calls-failed_calls-connected_calls AS not_connected_calls, failed_calls, TO_CHAR (100.0*connected_calls /attempt_calls,’999′) AS asr, TO_CHAR (100.0*(attempt_calls – failed_calls) /attempt_calls,’999′) AS ccr, CASE WHEN connected_calls > 0 THEN ROUND (totaldur /connected_calls,2) ELSE 0 END AS acd, ROUND (totalpdd /attempt_calls, 0) AS avg_pdd, totaldur FROM (SELECT ‘BTRAC’ AS o_carrier, ‘BTRAC’ AS t_carrier, SUM (attempt_calls) AS attempt_calls, SUM(connected_calls) AS connected_calls, SUM (failed_calls) AS failed_calls, ROUND(SUM(totaldur)/60.0, 2) AS totaldur, SUM(totalpdd) AS totalpdd FROM cdr15 WHERE switchid=’SCOM1′ AND enddate_end >= ‘2022-10-01 00:00:00+06’ AND enddate_end < ‘2022-10-01 01:45:00+06′ AND ingress_carrier=’BTRAC’ AND egress_carrier=’BTRAC’) AS foo;

gridphp gives an error –¬†Couldn’t execute query. ERROR: syntax error at or near “WHERE” LINE 1. Basically, it automatically adds¬†WHERE 1=1 LIMIT 1 OFFSET 0 in the end. How do I fix this issue?

FYI, I’m trying the free version to check if it suits my needs or not.

B/R,
Tanjim



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?