Question : SQL Statement Help

Hello,

I have a table that contains the following columns:-

DialCode
RatePerMinute
Date

An example of a few records would be:-

Record 1
---------
DialCode=5551234
RatePerMinute=0.05
Date=1-July-2010

Record 2
-----------
DialCode=5551234
RatePerMinute=0.045
Date=1-Aug-2010

Record 3
-----------
DialCode=441212346
RatePerMinute=0.12
Date=1-July-2010

Record 4
-----------
DialCode=441212346
RatePerMinute=0.14
Date=1-Aug-2010


Each month, I import a large list of rates from my telephone provider into my table.

Now, I want to generate an SQL statement that compares the current month with last month and outputs a list of rates that have changed.

There are over 8000 records added each month. So it would take quite a while for a client computer to carry out the comparison.

Can anyone help me write an sql statement that can do this?

Answer : SQL Statement Help

I'm not getting why, but it is indeed not working that way. Try
1:
2:
3:
4:
5:
6:
select * from
(select * from tblWholesaleRates where fdate = '2010-07-12') lm
full join 
(select * from tblWholesaleRates where fdate = '2010-08-10') tm
on lm.fCode = tm.fCode
where lm.fRatePeak <> tm.fRatePeak or lm.fRatePeak is null or tm.fRatePeak is null
Random Solutions  
 
programming4us programming4us