not good.
select * from
(select
r.IpAddressNum, v.VehicleIp, v.firmwareRev,
Count(r.ReportId) as ReportsInDatabase,
Count(DISTINCT timeId) as DistinctTimes, v.VehicleName, c.companyName
from reportsView r
INNER JOIN
vehicletable v
on v.IpAddressNumber = r.IpAddressNum
INNER JOIN
companyTable c
on v.companyIdNumber = c.companyIdNumber
where r.currentDate between '09-29-2003 00:00:00.000' and '09-29-2003
23:59:59.999'
Group By v.IpAddressNumber, r.IpAddressNum, v.VehicleName, v.VehicleIp,
c.companyName,v.firmwareRev
) a
where
Abs((reportsInDatabase-distinctTimes)/reportsInDatabase * 100) < 50
Order by ReportsInDatabase DESC
...tony
tony weeg
senior web applications architect
navtrak, inc.
www.navtrak.net
[EMAIL PROTECTED]
410.548.2337
-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 02, 2003 1:00 PM
To: CF-Talk
Subject: Re: sql question pt 2
Tony Weeg wrote:
> with about 5000 lines coming from sql server, if I do the math with a
> cfloop and cf tags in between, versus, calculating in sql server and
> discarding what I don't want....?
>
> what do you think?
SQL of course. Don't put off to the business layer what you can do in the
data layer. And who cares about performance when it is only 5000 lines
(probably SQL is faster anyway).
Jochem
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

