EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Posted: 2020-10-20 05:58 AM . Last Modified: 2023-05-03 12:08 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-10-20 05:58 AM . Last Modified: 2023-05-03 12:08 AM
Hello Everyone!
I would really appreciate some guidance using FULL OUTER JOIN in a Query List. I am trying to query data from 2 tables in Geo SCADA with different columns (and a common NoteNumber column that has unique values in both of the tables). I get this error - "Right Or Full Outer Joins are not supported". Is it not possible to use Full Outer Join in Geo SCADA? I need to do the following:
SELECT
COALESCE (E.NOTENUMBER, W.NOTENUMBER) AS "Note Number", E.EQUIPMENTID, W.WORKORDERID
FROM
EQUIPMENTNOTES AS E
FULL OUTER JOIN
WORKORDERNOTES AS W
ON
E.NOTENUMBER = W.NOTENUMBER
WHERE
E.NOTENUMBER IS NULL OR W.NOTENUMBER IS NULL
Thanks!
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-10-20 06:10 AM
As the error message says, the Geo SCADA Expert query processor doesn't support full outer joins.
The supported join types are documented in the online help:
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-10-21 10:03 PM
I'm not really sure what you're looking for here either....
I don't believe this is valid:
ON
E.NOTENUMBER = W.NOTENUMBER
WHERE
E.NOTENUMBER IS NULL OR W.NOTENUMBER IS NULL
In SQL Rules NULL does not match with NULL.
So...
You want to filter records so that you ONLY include records where either E.NOTENUMBER is NULL OR W.NOTENUMBER is NULL.
But then you're trying to do an outer join where you're looking for NULL = (anything) or (anything) = NULL, which is guaranteed to fail.
You have the COALESCE, so you are expecting that E.NOTENUMBER may be NULL.
What are you actually trying to obtain?
Maybe breaking it into parts...
So... you want all entries from the EQUIPMENTNOTES table:
SELECT E.NOTENUMBER as "Note Number", E.EQUIPMENTID, W.WORKORDERID
FROM EQUIPMENTNOTES AS E
LEFT JOIN WORKORDERNOTES AS W
ON E.NOTENUMBER= W.NOTENUMBER
and then all the WORKORDER entries that we didn't match before
UNION
SELECT WO.ORDERNOTES as "Note Number", NULL, W.WORKORDERID
FROM WORKORDERNOTES AS WO
LEFT JOIN EQUIPMENTNOTES AS EN
ON WO.NOTENUMBER=EN.NOTENUMBER
WHERE EN.NOTENUMBER IS NULL
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.