Re: select sum(qty*unitpri) wrong result

2006-05-28 Thread Dan Nelson
In the last episode (May 29), wang shuming said: > Hi, > table a1 > > qty int(10) , unitpri float(10,2) > 35019.80 > ... > 350 19.80(total 48 lines) > > select sum(qty*unitpri) from a1 > 332639.99 ,it should return 332640.00 > > mysql version 4.1.19 If you want exact a

ugly SQL for a report...

2006-05-28 Thread Cory
I have the following query that is running VERY slowly. Anyone have any suggestions? --- SELECT pnr.ID ID_pnr, pnr.reservationdatetime, pnr.conf_number, pnr.created_by, GROUP_CONCAT(pp.name_last,', ',pp.name_first ORDER BY name_last DESC SEPARATOR '') names, (SELECT SUM(pf.base_fare*(SELECT

select sum(qty*unitpri) wrong result

2006-05-28 Thread wang shuming
Hi, table a1 qty int(10) , unitpri foat(10,2) 35019.80 ... 350 19.80(total 48 lines) select sum(qty*unitpri) from a1 332639.99 ,it should return 332640.00 mysql version 4.1.19 Best regards! Shuming Wang

where more than 2 column not in a table

2006-05-28 Thread if04029
Sory if my question makes you confused I've a problem with my sintax, I don't know how to select a list, whether it's not registered in another table, but it have 2 IDs. I hope you will help me because I really need it for my study. Thank you in advance, regards, Eva Panjaitan 11104029 Stu

i'm at a complete loss?

2006-05-28 Thread Daniel McQuay
Hello list, I just installed MySQL on my FreeBSD box here at home and am having a few problems with privileges. I can connect to mysql using; mysql -u mysql and there is no password needed. However, when I try to connect to the server using root; mysql -u root I get an error; ERROR 1045 (28000):

Re: Get the record with the latest date

2006-05-28 Thread Kevin F. O'Riordan
Hi Brian, > Man, this took me two hours to figure out, but in the end, this worked! > SELECT ... max(date_time) ... It /appeared/ to work, but with different test data you should see that it isn't guaranteed to. Try inserting: INSERT INTO completed_modules (module_id, email, score, dat

RE: Get the record with the latest date

2006-05-28 Thread Brian Menke
Man, this took me two hours to figure out, but in the end, this worked! SELECT module_id, email, score, max(date_time) FROM completed_modules GROUP by module_id, email module_id email score max(date_time) 1 [EMAIL PROTECTED] 8 5/27/2006 1