Re: [SQL] mysql code questions

2009-08-12 Thread Greg Stark
On Wed, Aug 12, 2009 at 7:52 PM, Thomas Kellerer wrote: > Ray Stell wrote on 12.08.2009 20:19: > I would probably do it this way: > > SELECT tt. * > FROM testtable tt > WHERE create_date = (SELECT MAX(create_date) >                     FROM testtable tt2 >                     WHERE tt.id = tt2.id);

Re: [SQL] mysql code questions

2009-08-12 Thread Thomas Kellerer
Ray Stell wrote on 12.08.2009 20:19: http://www.brentozar.com/archive/2009/04/getting-the-most-recent-record/ How this works? What is ttNewer? What is a clustered primary key in mysql? That article talks about SQL Server not MySQL. select tt.* FROM TestTable tt LEFT OUTER JOIN TestTable

[SQL] mysql code questions

2009-08-12 Thread Ray Stell
http://www.brentozar.com/archive/2009/04/getting-the-most-recent-record/ How this works? What is ttNewer? What is a clustered primary key in mysql? This is as good as I can do to get this into pg: create table TestTable ( id int not null, create_date date not null, info1 VARCHAR(50) NOT NULL