I am testing the possibility to use Gambas to make Mysql database
projects. I have found how to add, modify, delete or display records
from a MySql table, but I have not found how to sort records.
(I have found no possibility for executing a SQL command "SELECT * FROM
table ORDER BY field")
Have somebody a response to that question ?
>I am testing the possibility to use Gambas to make Mysql database
>projects. I have found how to add, modify, delete or display records
>from a MySql table, but I have not found how to sort records.
>(I have found no possibility for executing a SQL command "SELECT * FROM
>table ORDER BY field")
>Have somebody a response to that question ?
- hConn is a properly opened connection and
- res is a result object
try the following:
res = hConn.Find("people","lastname=&1 AND firstname=&2 ORDER BY
birthdate DESC LIMIT 10","Doe","John")
It should give you up to 10 people named John Doe sorted descending by
Also of interest to you might be how to use the mysql library functions
such as MIN, MAX, AVG, SOUNDEX etc. There was a recent discussion on
this under the title "Exotic Mysql Problem". I quote it below. Actually
it's a good example why top posting is a bad idea :-)
Thanks, this worked perfectly.
However, i dont know whether this is a bug or a feature. Maybe we have
to ask MS to solve this mystery. :)
[hidden email] schrieb:
Not sure how you are using this but I have successfully tested the
rResult = hConn.Exec("Select max(field) as maxfield from table")
Does this help?
Message Received: Sep 29 2005, 08:27 PM
From: "Alex Ciric" To: [hidden email] Cc: Subject: [Gambas-user] Exotic Mysql Problem
In my application i have to use the mysql-macro max().
If i do a query like "select * from table" this works very good with
gambas and i am able to use the results for further stuff.
But if i do a query like "select max(field) from table" i get an error
message "field not found in myqsl table"
Does anyone know this behavior or have a workaround?