MySQL Forums
Forum List  »  Connector/Python

Re: How to get the value of aggregate functions using MySQL Connector/Python?
Posted by: Geert Vanderkelen
Date: March 19, 2014 05:43AM

Ernest Bonat Wrote:
-------------------------------------------------------
..
> print(data)
>
> This will print:
>
> [(20,)]
>
> Two questions:
>
> 1. How to get the real 20 records value?

Not sure what you mean, but is this what you want?

print(data[0][0])

> 2. If this the correct code to get the values of
> the MySQL aggregate functions?

Yes. There is no difference between functions and column values when the connector receives it.

Cheers,
Geert

Geert Vanderkelen
Software Developer at Oracle

Options: ReplyQuote


Subject
Written By
Posted
Re: How to get the value of aggregate functions using MySQL Connector/Python?
March 19, 2014 05:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.