Re: select in Mysql 4.0

2004-07-27 Thread Michael Stassen
Michael Stassen" <[EMAIL PROTECTED]> To: "fgmmoribe" <[EMAIL PROTECTED]> Cc: "mysql" <[EMAIL PROTECTED]> Sent: Tuesday, July 27, 2004 7:11 AM Subject: Re: select in Mysql 4.0 fgmmoribe wrote: I have a table like this +-+---+---

Re: select in Mysql 4.0

2004-07-27 Thread SGreen
To get the one record with the MAX() value in a field, I would do: SELECT @maxcod:=max(cod) from #temp; SELECT * from #temp where cod = @maxcod; To get all of the records with the max(cod) value for each idtable value, I would use a temp table: create temporary table tmpMax SELECT idtable, max(

Re: select in Mysql 4.0

2004-07-26 Thread Jocelyn Fournier
IL PROTECTED]> Sent: Tuesday, July 27, 2004 7:11 AM Subject: Re: select in Mysql 4.0 > > fgmmoribe wrote: > > I have a table like this > > > > +-+---+--+-+-+--

Re: select in Mysql 4.0

2004-07-26 Thread Michael Stassen
fgmmoribe wrote: I have a table like this +-+---+--+-+-++ | Field | Type | Null | Key | Default | Extra | +-+---+--+-+-++ | id | int(3)

select in Mysql 4.0

2004-07-26 Thread fgmmoribe
I have a table like this +---+-+--+-+-++ | Field | Type | Null | Key | Default | Extra | +---+-+--+-+-++ | id | int(3) | | PRI | NULL | auto_increment | | idTable | int(3) unsig