Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
results of divide by zero in MySQL
select x,y,x/y from ( select a, sum(x) x, count(y) y from ( select 1 a, 2 x, 3 y union all select 1, 3, 1 union all select 1, 3, 1 union all select 1,70, 1 union all select 1,93, 1 union all select 1,83, 1 union all select 1, 3, 1 union all select 2, 3, 1 union all select 2, 3, 1 union all select 2, 3, 1 union all select 2,13, 1 union all select 2, 3, 1 union all select 2, 3, 1 union all select 3,13, 1 union all select 3, 3, 1 union all select 3,10, 1 union all select 3, 3, 1 union all select 3, 3, 1 union all select 3, 3, 2 union all select 4,43, null union all select 4, 3, null union all select 4, 3, null union all select 5, null ,6 union all select 5, null ,null union all select 5, null ,7 ) t group by a ) tbl
run
|
edit
|
history
|
help
0
Build table horizontally
SMI_SQL
cs
ITM_14210069
suraj222
Charles Chung
Running interval
admin@pkms99.info
Mycreation
SELECT YEAR('2019-08-15 01:02:03')+10