cancel
Showing results for 
Search instead for 
Did you mean: 

LIMIT 1 doesn't work in subquery?

Former Member
0 Kudos

Hello!

I want to select only one corresponding value from the "building_file" table (as there can be multiple values), but it seems like it doesn't work when I try to use "limit 1" or "rowno <=1" in subquery.


select * from (select file_name, id_building from building_file where id_type=1 limit 1) t1, (select id, id_building from building) t2
where
t1.id_building(+) = t2.id_building
order by 1

So I suppose "limit 1" cannot be used in subqueries? I have not found any entries in documentation on this issue.

Where am I wrong?

Thanks in advance,

Alex.

Accepted Solutions (0)

Answers (1)

Answers (1)

lbreddemann
Active Contributor
0 Kudos

Hi Alex,

what version of MaxDB are you working with?

And what SQL mode are you using?

Do you get any error messages?

I was able to use the rowno predicate in a subquery on 7.7.06 Build 15.

Anyhow, the LIMIT clause did not work.

I guess that's because the LIMIT conditions are really just evaluated on the final result table.

regards,

Lars