Re: Order by price?

2004-04-29 Thread Daniel Clark
I think when adding the $ the number gets convert to a string. And then the query orders it by alpha numberic. I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA*(establishments^2)+$varB*(establishments)+$varC),2)) as price FROM table ORDER BY price A note first. The column

Re: Order by price?

2004-04-29 Thread Robert J Taylor
Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA*(establishments^2)+$varB*(establishments)+$varC),2)) as price FROM table ORDER BY price Hint: you've made this a string comparison using CONCAT, i.e., alphabetical, not numerical, sorting rules apply. How

Re: Order by price?

2004-04-29 Thread Paul DuBois
At 12:14 -0500 4/29/04, Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA*(establishments^2)+$varB*(establishments)+$varC),2)) as price FROM table ORDER BY price A note first. The column establishments is an int(10), as you see I am taking this number through a

RE: Order by price?

2004-04-29 Thread Yoed Anis
, Yoed -Original Message- From: Robert J Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 12:23 PM To: Yoed Anis; [EMAIL PROTECTED] Subject: Re: Order by price? Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA*(establishments^2)+$varB

Re: Order by price?

2004-04-29 Thread Robert J Taylor
Paul DuBois wrote: *snip* Sounds like you want: ORDER BY ROUND(($varA*(establishments^2)+$varB*(establishments)+$varC),2) Perfect. (I'm saying, duh over here to myself!) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

RE: Order by price?

2004-04-29 Thread Yoed Anis
. Best, Yoed -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED] Sent: Thursday, April 29, 2004 12:28 PM To: Yoed Anis; [EMAIL PROTECTED] Subject: Re: Order by price? At 12:14 -0500 4/29/04, Yoed Anis wrote: I'm having trouble with this query: SELECT CONCAT('$',ROUND(($varA

Re: Order by price?

2004-04-29 Thread Gerald Taylor
I want to count the passing and failing scores of a group of tests so I have a table with a row that describes each test Each test has a minimum passing score. Each test can be run an arbitrary number of times so I have a table of scores, which uses test id as a foreign key. what I would like