MySQL query equivalent...
Hey Folks,
I'm working with a MySQL database I converted from Oracle.
I already have many Oracle queries documented. Can somebody
help me convert one of them to a MySQL query?
This is one of the Oracle queries:
select '0' page_val, (c.statecd*1000+c.countycd) row_val, decode(nvl(c.stdszcd,-1),
1,'`ld`',
2,'`md`',
3,'`sd`',
4,'`ch`',
5,'`ns`',
-1,'`nc`',
'`0007 Other`') col_val, sum(nvl(c.condprop_curr* 1,0)) attribute from nm.SNAPSHOT_cond c, nm.SNAPSHOT_plot p,nm.SNAPSHOT_plot_geom pg
where
p.ry_cn=c.ry_plt_cn and
p.ry_cn=pg.ry_cn and
c.condprop_curr<>0 and
( (p.statecd=01 and p.reportyr=2003 and p.countycd in (001))) and
c.cond_status_cd in (1,2,3)
group by '0',(c.statecd*1000+c.countycd),decode(nvl(c.stdszcd,-1),
1,'`ld`',
2,'`md`',
3,'`sd`',
4,'`ch`',
5,'`ns`',
-1,'`nc`','`0007 Other`')
Thanks.
T. Lo
WSFR, UGA