[Ur] outer join + inner sql request
Sergey Mironov
grrwlf at gmail.com
Sat Oct 18 15:19:50 EDT 2014
Hi! I want to write a complex SQL request that would outer join two
tables after applying a filter to one of them. Here is the prototype:
table groups : ([Id = int] ++ ... (*not important*) )
table compet_groups : ([CId = int, GId = int])
query(
SELECT *
FROM groups AS G LEFT OUTER JOIN (SELECT * FROM
compet_groups WHERE CId = 1) AS CG ON CG.GId = G.Id
)
Unfortunately, attempting to compile it fails with an error
/home/grwlf/proj/urweb-homepage/lib/urweb-compet/src/Compet.ur:459:44:
(to 460:17) Error in final record unification
Can't unify record constructors
Have: [Compet_groups = [CId = int, GId = int]]
Need: []
I've tried the same query with [psql] and it worked. Is there anything
I can do to implement this logic in Ur/Web?
Regards,
Sergey
More information about the Ur
mailing list