Sign in to follow this  
Followers 0
erikson

sql question

2 posts in this topic

Hi

how i cand get the biggest value ( is a decimal field) from a database?

i use mysql.au3

i try something like this

$ord = _Query($sql,"SELECT crt, MAX(my_field) FROM table GROUP BY obs")

With $ord

$test = .Fields("my_field").value

filewrite ("c:\order.txt", $test)

While NOT .EOF

.MoveNext

WEnd

EndWith

but don`t work

Share this post


Link to post
Share on other sites



Hi

how i cand get the biggest value ( is a decimal field) from a database?

i use mysql.au3

i try something like this

$ord = _Query($sql,"SELECT crt, MAX(my_field) FROM table GROUP BY obs")

With $ord

$test = .Fields("my_field").value

filewrite ("c:\order.txt", $test)

While NOT .EOF

.MoveNext

WEnd

EndWith

but don`t work

1) use crt in GROUP BY

2) read value inside While loop (and not outside)

3) I'm not sure if .Fields ("my_field") is corrects, test real names of columns

Something like this (not tested):

$ord = _Query ($sql, "SELECT crt, MAX(my_field) FROM table GROUP BY crt")
$test = ''

With $ord
    While Not .EOF
        $test &= .Fields ("my_field").value
        .MoveNext
    WEnd
EndWith

FileWrite("c:\order.txt", $test)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0