List:MySQL++« Previous MessageNext Message »
From:Björn Persson Date:May 24 2006 1:05pm
Subject:Re: minimum calculation
View as plain text  
Tomas Fischer wrote:
> How can I get the result of following query?
>
> query << "SELECT MIN(EURO) from stock"
> res= query.store()
> row= *res.begin()
>
> row["EURO"] or row[0] doesn' work...

I assume you're using MySQL++ 2.

To retrieve the value by position, use row.at(0). In row[0], the 0 is taken as 
a NULL char*. (I'm sure Warren does know this.)

To retrieve it by name you could try row["MIN(EURO)"]. If that doesn't work, 
set an alias in the query and ask for that. That is, "select min(euro) as 
some_name from stock" and then row["some_name"].

Björn Persson
Thread
minimum calculationTomas Fischer23 May
  • Re: minimum calculationWarren Young24 May
  • Re: minimum calculationBjörn Persson24 May