vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello I have the following problem: For the data in the TABLE: ID DATA TEXT 3 1994-02-11 Some not important text 3 1995-02-11 Some not important text 3 1996-02-11 Some not important text 3 1998-04-11 Very important text 4 1992-02-11 Some not important text 4 1994-02-11 Some not important text 4 1999-02-11 The test 5 1996-02-11 Some not important text 5 1997-02-11 Strange I do the following query: SELECT ID, MAX(DATA), TEXT FROM TABLE ORDER BY ID GROUP BY ID; I got the result: 3 1998-04-11 Some not important text 4 1999-02-11 Some not important text 5 1997-02-11 Some not important text My question is : How to get the result 3 1998-04-11 Very important text 4 1999-02-11 The test 5 1997-02-11 Strange Any ideas. Best Spidernet. |
| ||||
| jacek_witkowski@wp.pl wrote: > Hello I have the following problem: > For the data in the TABLE: > > ID DATA TEXT > 3 1994-02-11 Some not important text > 3 1995-02-11 Some not important text > 3 1996-02-11 Some not important text > 3 1998-04-11 Very important text > 4 1992-02-11 Some not important text > 4 1994-02-11 Some not important text > 4 1999-02-11 The test > 5 1996-02-11 Some not important text > 5 1997-02-11 Strange > > > I do the following query: > SELECT ID, MAX(DATA), TEXT FROM TABLE ORDER BY ID GROUP BY ID; > > I got the result: > 3 1998-04-11 Some not important text > 4 1999-02-11 Some not important text > 5 1997-02-11 Some not important text > > My question is : How to get the result > > 3 1998-04-11 Very important text > 4 1999-02-11 The test > 5 1997-02-11 Strange > > > Any ideas. > > Best > > Spidernet. The answer is the same as the answer to just about every other query- related question in this NG. Try reading around a bit before posting! |