Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Same query, different results

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And a second question,





This is the library I am using
http://technojeeves.com/joomla/i ... ltset-to-tablemodel
The product name is missing
same query, different results.jpg
[Thumbnail for same query, different results.jpg]
Different results.jpg
[Thumbnail for Different results.jpg]
 
K. Tsang
Bartender
Posts: 3610
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean different as in one result got an extra decimal point?

To be consistent, ideally you should round after you sum IFNULL(round(sum(od.NetSales), 2), 0)

Or even better do the IFNULL check before you round.

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. Tsang wrote:You mean different as in one result got an extra decimal point?

To be consistent, ideally you should round after you sum IFNULL(round(sum(od.NetSales), 2), 0)

Or even better do the IFNULL check before you round.



Hi K Tsang,
I mean the product name was missing in the query inside Java.
I don't know why, I cut N paste the query to SQLite Manager,
It works, but when in java, it doesn't
The thing was so similar, I can't see why it differs
Thanks
Jack
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!