ORDER BY calculated field

2008-03-20 Thread Neil Tompkins
Hi, How do I achieve a SQL statement to order my results based on two calculated fields for example : SELECT COUNT(ProductsPurchases.ProductID) as varProductCount, Products.Name, Products.ProductReview FROM ProductsPurchasesINNER JOIN Products ON Products.ProductID =

Re: ORDER BY calculated field

2008-03-20 Thread Sebastian Mendel
Neil Tompkins schrieb: Hi, How do I achieve a SQL statement to order my results based on two calculated fields for example : what two calculated fields? SELECT COUNT(ProductsPurchases.ProductID) as varProductCount, Products.Name, Products.ProductReview FROM ProductsPurchasesINNER JOIN

RE: ORDER BY calculated field

2008-03-20 Thread Neil Tompkins
Hi I want to order by the totalled fields varProductCount and Products.ProductReviewDESC Neil Date: Thu, 20 Mar 2008 11:36:30 +0100 From: [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Re: ORDER BY calculated field Neil Tompkins schrieb: Hi,How do I achieve a SQL statement

Re: ORDER BY calculated field

2008-03-20 Thread Sebastian Mendel
Neil Tompkins schrieb: Hi I want to order by the totalled fields varProductCount and Products.ProductReviewDESC just put them together, separated with comma, like it is written in the manual ORDER BY varProductCount + Products.ProductReviewDESC, COUNT(ProductsPurchases.ProductID) -- MySQL

Re: ORDER BY calculated field

2008-03-20 Thread Sebastian Mendel
Sebastian Mendel schrieb: Neil Tompkins schrieb: Hi I want to order by the totalled fields varProductCount and Products.ProductReviewDESC just put them together, separated with comma, like it is written in the manual ORDER BY varProductCount + Products.ProductReviewDESC,

Re: ORDER BY calculated field

2008-03-20 Thread Sebastian Mendel
Neil Tompkins schrieb: Thanks Sebastian, but I now get the error message [MySQL][ODBC 3.51 Driver][mysqld-3.23.58]Invalid use of group function i am not familiar with ODBC or MySQL 3.x but possible just GROUP BY is missing check the manual for your mysql version for the exact syntax if

RE: ORDER BY calculated field

2008-03-20 Thread Neil Tompkins
Thanks Sebastian, but I now get the error message [MySQL][ODBC 3.51 Driver][mysqld-3.23.58]Invalid use of group function Date: Thu, 20 Mar 2008 12:59:22 +0100 From: [EMAIL PROTECTED] To: mysql@lists.mysql.com Subject: Re: ORDER BY calculated field Sebastian Mendel schrieb: Neil

RE: ORDER BY calculated field

2008-03-20 Thread Neil Tompkins
= ProductsPurchases.ProductIDGROUP BY Products.ProductID ORDER BY varProductCount DESC Date: Thu, 20 Mar 2008 13:08:51 +0100 From: [EMAIL PROTECTED] CC: mysql@lists.mysql.com Subject: Re: ORDER BY calculated field Neil Tompkins schrieb: Thanks Sebastian, but I now get the error message [MySQL][ODBC 3.51

calculated field

2005-01-21 Thread Javier
Hi All I've an Excel document that have some data but there are a column that has a formula related to other cells of the same row. Now I need to put data in a db but the problem is with this calculated data. A friend of mine that use Oracle told me that I could define a field like field1 =

Re: calculated field

2005-01-21 Thread Jason Martin
a table that way. However when selecting the data you can do select (field2+field3) FIELD1, field2, field3 from table such that you'll get the calculated field. -Jason Martin -- When I tried to take an ego trip I got stopped at the border This message is PGP/MIME signed. pgpwOoiS87sEx.pgp

Re: calculated field

2005-01-21 Thread V. M. Brasseur
To the best of my knowledge MySQL does not have a way to do this on the fly such that a field value is contigent upon the values of other fields in the table. Does it have to be stored in the database at all? Seems to me that calculated values often are best handled at query time rather than

RE: calculated field

2005-01-21 Thread Jay Blanchard
[snip] Now I need to put data in a db but the problem is with this calculated data. A friend of mine that use Oracle told me that I could define a field like field1 = field2 + field3, but I can't discover this option in Mysql. It's possible to make it ? Any other idea about it ? [/snip] Have you

Calculated Field

2001-03-01 Thread Dan Higgins
How do I set up a field called Minutes which has the (default) value, where round((SessionTime+30)/60) = Minutes Is it possible to set this up? In other databases (Alpha Five) I would have used a Calculated Field attribute to achieve this. Can MySql handle it.. ??? -- Daniel M O

Re: Calculated Field

2001-03-01 Thread Basil Hussain
Hi, How do I set up a field called Minutes which has the (default) value, where round((SessionTime+30)/60) = Minutes Is it possible to set this up? In other databases (Alpha Five) I would have used a Calculated Field attribute to achieve this. Can MySql handle it.. ??? In SQL