Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

log/log10 functions truncate my resultset
Hello all,

I have a table that contains 100+ rows. I'm trying to run a query that
looks like this:
SELECT ..., log10(...) as Rank FROM Table
and the resultset contains only the first row of results.

SELECT ..., log10(...) as Rank FROM Table ORDER BY Rank
returns no results at all!

If you replace log10 with log, it does the same thing. However, if you
replace log10 with abs, it returns exactly what you'd expect, all 100+
rows.

Any thoughts?

Thanks in advance!


Report this thread to moderator Post Follow-up to this message
Old Post
BernsteinVsTheDb
02-25-06 02:45 PM


Re: log/log10 functions truncate my resultset
My guess is that the math the DBMS is doing blows up on the row
after the last one you get. Is the connection to the DBMS still OK?
Joe Weinstein at BEA Systems


Report this thread to moderator Post Follow-up to this message
Old Post
joeNOSPAM@BEA.com
02-25-06 02:45 PM


Re: log/log10 functions truncate my resultset
BernsteinVsTheDb (Orr.Bernstein@gmail.com)  writes:
> Hello all,
>
> I have a table that contains 100+ rows. I'm trying to run a query that
> looks like this:
> SELECT ..., log10(...) as Rank FROM Table
> and the resultset contains only the first row of results.
>
> SELECT ..., log10(...) as Rank FROM Table ORDER BY Rank
> returns no results at all!
>
> If you replace log10 with log, it does the same thing. However, if you
> replace log10 with abs, it returns exactly what you'd expect, all 100+
> rows.

Are all the numbers you perform log/log10 on > 0?

Do you run the query from an application or from Query Analyzer? In
the latter case, you should get an error message.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Report this thread to moderator Post Follow-up to this message
Old Post
Erland Sommarskog
02-25-06 02:45 PM


Re: log/log10 functions truncate my resultset
On Feb 24 2006, 06:09 pm, Erland Sommarskog <esquel@sommarskog.se> wrote in
 news:Xns9775190B2482
Yazorman@127.0.0.1:

> BernsteinVsTheDb (Orr.Bernstein@gmail.com) writes: 
>
> Are all the numbers you perform log/log10 on > 0?

Funny thing is, I had this exact issue today while ranking results.
Log10(0) produces a "A domain error occured" warning message in QA and
causes an empty result set to be returned.

--
remove a 9 to reply by email

Report this thread to moderator Post Follow-up to this message
Old Post
Dimitri Furman
02-25-06 02:45 PM


Sponsored Links





Last Thread Next Thread
Post New Thread

Microsoft SQL Server forum archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 04:22 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006