473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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!

Feb 24 '06 #1
3 1808
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

Feb 24 '06 #2
BernsteinVsTheDb (Or***********@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, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 24 '06 #3
On Feb 24 2006, 06:09 pm, Erland Sommarskog <es****@sommarskog.se> wrote in
news:Xn*********************@127.0.0.1:
BernsteinVsTheDb (Or***********@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?


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
Feb 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RoyalScorpion | last post by:
hi guys, i get an updatable resultset from a connection then used it to insert a new row but the result set doesn't chane after insertion, i mean the no of rows before insertion is the same after...
2
by: Savas Ates | last post by:
I have a stored procedure below.. When I run it with a well parameter in query analyser 3 of select statements return me. (i named select statements 1,2,3) But in asp page when i call this...
3
by: jrefactors | last post by:
I want to ask what are the possiblities to truncate data from 1 million dollars to 1 dollar by using formatCurrency and CCur functions? The ASP page has code <%= formatCurrency(rs(14)) %>, the...
0
by: BuddyWork | last post by:
Hello, Here is an update. There is no differences with the function System.Math.Log10 under any operating system. The problem is with the casting of the datatype double and value Infinite...
4
by: _link98 | last post by:
Problem: java ResultSet cursor from SQL/PL stored-procedure is FORWARD_ONLY. Is it possible to have ResultSet cursors from SQL/PL procedures to scroll forward and backwards? Perhaps I am missing...
2
by: RB Smissaert | last post by:
Just starting with C++ in MS VC6++. Why does this: return (log10(70)); produce 1 and not 1.845098 ? I can see it is giving me the rounded integer number, but why? The return type of the...
12
by: Arash Partow | last post by:
Hi all, I've ported various hash functions to python if anyone is interested: def RSHash(key): a = 378551 b = 63689 hash = 0
13
by: ptn | last post by:
Hi everyone, I was messing around with math.h and I got this error: """ /tmp/ccefZYYN.o: In function `digcount': itos.c:(.text+0x103): undefined reference to `log10' itos.c:(.text+0x111):...
27
by: Aaron Hsu | last post by:
Hey all, After seeing the Secure version I/O functions thread, it occured to me that maybe not everyone agrees with the almost universal adage that I have heard. I have Always been told that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.