A
ajmister
Hi
I have a table
Create table tmp_name
( name char(15),
sales float,
yr char (4),
mth char (2)
)
and it has the following data
Joe Smith 15452.00 2001 03
Joe Smith 12157.00 2001 06
Joe Smith 14342.00 2001 09
Joe Smith 12429.00 2001 12
Joe Smith 13434.00 2002 03
Joe Smith 15529.00 2002 06
Joe Smith 15352.00 2002 09
Joe Smith 16436.00 2002 12
and I need to extract data for (max (yr) + max(mth)) and ((max(yr) +
max(mth)) - 12 mth) i.e.
name sales cur_yr cur_mth sales prv_yr
prv_mth
Joe Smith 16436.00 2002 12 12429.00 2001 12
Any suggestions
Ajay
I have a table
Create table tmp_name
( name char(15),
sales float,
yr char (4),
mth char (2)
)
and it has the following data
Joe Smith 15452.00 2001 03
Joe Smith 12157.00 2001 06
Joe Smith 14342.00 2001 09
Joe Smith 12429.00 2001 12
Joe Smith 13434.00 2002 03
Joe Smith 15529.00 2002 06
Joe Smith 15352.00 2002 09
Joe Smith 16436.00 2002 12
and I need to extract data for (max (yr) + max(mth)) and ((max(yr) +
max(mth)) - 12 mth) i.e.
name sales cur_yr cur_mth sales prv_yr
prv_mth
Joe Smith 16436.00 2002 12 12429.00 2001 12
Any suggestions
Ajay