Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Prologsuperquery

Language: Layout:
- ] Show input
Absolute running time: 0.33 sec, cpu time: 0.18 sec, memory peak: 7 Mb, absolute service time: 0,44 sec  
edit mode |  history  | discussion
select tabla1, count()/(select count() from arbol ) as probabilidad from arbol where tabla1 in(select distinct tabla1 from arbol )  group by tabla1 ;  

select tabla1, tabla2, count()/(select count() from arbol ) as Probabilidad from arbol where tabla1 in(select distint tabla1 from arbol )  and tabla2 in(select distint tabla2 from arbol) group by tabla2, tabla1 order by tabla1, tabla2;
true.