SQL LEAD() PARTITION BY ISSUE
I have a JOIN on the following select statement in injected sql
JOIN (SELECT
g.id,
lead(g.id) over (partition by g.sid_grade ORDER BY g.ordering) AS next_id
FROM
grade g
WHERE
g.status = 'Active')
If I omit the g. prefix in the partition by clause, sid_grade is not found in the table
Please sign in to leave a comment.
This is in injected sql
Open File | Settings | Languages & Frameworks | SQL Resolution Scopes and map your project/files with a particular schema.
See some more info at https://www.jetbrains.com/help/phpstorm/settings-languages-sql-resolution-scopes.html
That's done. As soon as I add the prefix it works, along with all the other sql which is resolved