I have a View with several Subqueries, one of them should be used to generate another Subquery within the View itself but I'm getting error, eg:
(SELECT COUNT(0)
FROM 'LICENCAS'
WHERE ('LICENCAS'.'FK_PEDIDO' = 'A'.'FK_PEDIDO') AND Dia_Corrido_Assinatura > 'LICENCAS'.'CICLO') AS 'DownloadCount',
(SELECT CEILING((TIMESTAMPDIFF(SECOND, 'A.''ASSINATURA_DATA_INICIO', NOW()) / 86400))) AS 'Dia_Corrido_Assinatura',
FROM 'N_ASSINATURAS' 'A'
I'm having trouble with Subquery DownloadCount
because inside it I call the value of Subquery Dia_Corrido_Assinatura
however I get the message:
Error Code: 1247. Reference 'Script_Day_day' not supported (forward reference in item list)
I understand that since it is a Subquery, it may not have even been generated to be called, are there any options on top of that?
EDIT: I've already tried to change order by putting the sub 'Script_Day_Day' first, but continue with the same error.