Hi, I joined table with sequense numbers whith one-row table. I expect one
row in result set. But in some cases there are two or three rows in result
set. Isn't it a bug?
-- CREATE TABLE AND ADD NUMBERS FROM 1 TO 100
drop table if exists test;
create table test (nbr int);
with cte_seq (nbr) as
(
select 1 nbr from dual
union all
select t.nbr + 1 nbr from cte_seq t where t.nbr < 100
)
insert into test (nbr)
select t.nbr from cte_seq t;
-- JOIN TABLE WITH NUMBERS WITH ONE-ROW TABLE
select t.nbr, m.rnd
from test t
join (select cast(ceil(random() * 100) as int) rnd from dual) m
on m.rnd = t.nbr
;
/* RESULTS:
NBR | RND
----+----
5 | 5
23 | 23
39 | 39
*/
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/h2-database/54727b3d-2f23-4a74-bc80-68edc734c691n%40googlegroups.com.