on 2021 Mar 10 7:29 PM
Hello,
I'm a beginner and I'm trying this query with union but it doesn't work and I don't understand where I'm wrong.
I followed what is explained here FlexibleSearch Tips and Tricks.
Both of the queries that make the union taken individually work fine but when i put them together with union It gives to me: cannot find (visible) type for alias uniontable within []
I also tried without the curly braces around uniontable.PK but it gives to me: Incorrect syntax near the keyword 'SELECT, so i think this is not the problem.
Thank you in advance for help.
SELECT {uniontable.PK} FROM
(
{{
SELECT {cn.PK}
FROM {
CriticalNews AS cn
LEFT JOIN news2pointofservice AS n2p ON {n2p.source}={cn.PK}
}
WHERE {cn.cooperative} = '8796093074984' AND {n2p.target} IS NULL
}}
UNION
{{
SELECT {cn.PK}
FROM {
CriticalNews AS cn
JOIN news2pointofservice AS n2p ON {n2p.source}={cn.PK}
JOIN PointOfService AS pos ON {pos.PK}={n2p.target}
}
WHERE {pos.name} = '009192'
}}
)uniontable
Hello,
I think 'uniontable' should not be used with braces.
Try and check.
Thanks
SELECT uniontable.PK FROM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Leo, I tried your tips but unfortunately it still doesn't work
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.