SELECT aq.display_name, lqasc.ag_num, lqasc.timeofupdate AS tou, lqasc.is_loggedin_in_queue AS ili FROM queue_view as aq RIGHT JOIN ( WITH cte AS ( SELECT a.q_num, a.ag_num, a.timeofupdate, a.is_loggedin_in_queue, ROW_NUMBER() OVER (PARTITION BY q_num, ag_num ORDER BY timeofupdate DESC) AS rn FROM callcent_ag_queuestatus a ) SELECT * FROM cte WHERE rn = 1 ) AS lqasc ON aq.dn = lqasc.q_num WHERE aq.dn<>'850' AND aq.dn<>'815'
So I started breaking down the parts put just:
WITH cte AS ( SELECT a.q_num, a.ag_num, a.timeofupdate, a.is_loggedin_in_queue, ROW_NUMBER() OVER (PARTITION BY q_num, ag_num ORDER BY timeofupdate DESC) AS rn FROM callcent_ag_queuestatus a ) SELECT * FROM cte WHERE rn = 1
And that resulted in an error message pop up saying
WITH not implemented.
I need this query to work. I have read only access to the database server, so I cannot create a view.
I got no results when I run the query :
SELECT aq.display_name, lqasc.ag_num, lqasc.timeofupdate AS tou, lqasc.is_loggedin_in_queue AS ili FROM queue_view as aq
RIGHT JOIN
(
WITH cte AS
(
SELECT a.q_num, a.ag_num, a.timeofupdate, a.is_loggedin_in_queue,
ROW_NUMBER() OVER (PARTITION BY q_num, ag_num ORDER BY timeofupdate DESC) AS rn
FROM callcent_ag_queuestatus a
)
SELECT *
FROM cte
WHERE rn = 1
) AS lqasc
ON aq.dn = lqasc.q_num
WHERE aq.dn<>'850' AND aq.dn<>'815'
So I started breaking down the parts put just:
WITH cte AS
(
SELECT a.q_num, a.ag_num, a.timeofupdate, a.is_loggedin_in_queue,
ROW_NUMBER() OVER (PARTITION BY q_num, ag_num ORDER BY timeofupdate DESC) AS rn
FROM callcent_ag_queuestatus a
)
SELECT *
FROM cte
WHERE rn = 1
And that resulted in an error message pop up saying
WITH not implemented.
I need this query to work. I have read only access to the database server, so I cannot create a view.This is using POSTGRESQL.
Hello David
Thank you for your purchase.
Our logic is based on a PHP SQL parser which has full support for the SQL dialect for the following statement types
SELECT, INSERT, UPDATE, DELETE, REPLACE, RENAME, SHOW, SET, DROP, CREATE INDEX, CREATE TABLE, EXPLAIN and DESCRIBE.
Some of them are disabled for security reasons.
WITH is not supported, unfortunately.
This can only be done with a MySQL view and you won't be able to do it through the plugin directly.
Kind Regards,
Aleksandar Vuković
[email protected]
Rate my support
wpDataTables: FAQ | Facebook | Twitter | Instagram | Front-end and back-end demo | Docs
Amelia: FAQ | Facebook | Twitter | Instagram | Amelia demo sites | Docs | Discord Community
You can try wpDataTables add-ons before purchasing on these sandbox sites:
Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables