![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
#4
| |||
| |||
|
|
What you've stumbled upon appears to be a bug in scalar subqueries. The "variables" in the error message are probably referring to the correlation variables in the scalar subquery. Interestingly, I was able to get your query to execute by switching the *-+ '1 year'-* expression to a *-- '1 year'-* expression, as shown below: Code: -------------------- select * from points p where not exists ( select * from spent_points sp where p.offender_nr = sp.offender_nr and p.offence = sp.offence and p.offence_date = sp.offence_date ) and date('today')-p.points_effective_from - '1 year' >= (select sum(pr.stop_effective_until- ps.stop_effective_from) from point_stops ps, point_restarts pr where ps.offender_nr = p.offender_nr and ps.offender_nr = pr.offender_nr and ps.stop_effective_from >= p.points_effective_from) \g -------------------- -- zelaine ------------------------------------------------------------------------ zelaine's Profile:http://community.ingres.com/forum/me...p?userid=13865 View this thread:http://community.ingres.com/forum/sh...ad.php?t=12763 |
#5
| |||
| |||
|
|
Wow thank you. Completely random but heh, if it works why not? Why did you try that? |
. Actually, I was trying to narrow down the query to the
#6
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |