Click here to Skip to main content
15,900,369 members
Home / Discussions / Database
   

Database

 
AnswerRe: selecting MAX date records Pin
Mike Ellison20-Feb-06 12:29
Mike Ellison20-Feb-06 12:29 
QuestionA simple query Pin
sacoskun20-Feb-06 9:18
sacoskun20-Feb-06 9:18 
AnswerRe: A simple query Pin
Mike Ellison20-Feb-06 18:21
Mike Ellison20-Feb-06 18:21 
Questiondistinct columns? Pin
nixter99920-Feb-06 3:42
nixter99920-Feb-06 3:42 
AnswerRe: distinct columns? Pin
Chris Meech20-Feb-06 4:02
Chris Meech20-Feb-06 4:02 
GeneralRe: distinct columns? Pin
nixter99920-Feb-06 4:15
nixter99920-Feb-06 4:15 
GeneralRe: distinct columns? Pin
Joshua Lunsford20-Feb-06 12:01
Joshua Lunsford20-Feb-06 12:01 
GeneralRe: distinct columns? Pin
Chris Meech21-Feb-06 3:53
Chris Meech21-Feb-06 3:53 
Your getting exactly what you ask for! Which in this case is what's the MAX of the domain column and the MIN of the date column. I think what you are after is the row of data, that is identified by the MAX of the domain column. To do that you need to use a subquery or a view. Here's using a subquery.
select tt.userid, tt.domain, tt.date
  from ( select m.userid, max(m.domain)
           from testtable m
          group by m.userid
       ) tmp
      , testtable tt
 where tt.userid = tmp.userid
   and tt.domain = tmp.domain
;



Chris Meech

I am Canadian. [heard in a local bar]

When I want privacy, I'll close the bathroom door. [Stan Shannon]

BAD DAY FOR: Friendly competition, as Ford Motor Co. declared the employee parking lot at its truck plant in Dearborn, Mich., off limits to vehicles built by rival companies. Workers have to drive a Ford to work, or park across the street. [CNNMoney.com]

Nice sig! [Tim Deveaux on Matt Newman's sig with a quote from me]
QuestionTyped dataset and ReadXml Pin
slappe20-Feb-06 2:37
slappe20-Feb-06 2:37 
QuestioncomboBox1.ValueMember = "column1" Pin
myNameIsRon19-Feb-06 11:51
myNameIsRon19-Feb-06 11:51 
AnswerRe: comboBox1.ValueMember = "column1" Pin
Ritesh123419-Feb-06 18:37
Ritesh123419-Feb-06 18:37 
GeneralRe: comboBox1.ValueMember = "column1" Pin
myNameIsRon20-Feb-06 12:50
myNameIsRon20-Feb-06 12:50 
AnswerRe: comboBox1.ValueMember = "column1" Pin
AlexeiXX320-Feb-06 7:18
AlexeiXX320-Feb-06 7:18 
GeneralRe: comboBox1.ValueMember = "column1" Pin
myNameIsRon20-Feb-06 12:45
myNameIsRon20-Feb-06 12:45 
GeneralRe: comboBox1.ValueMember = "column1" Pin
AlexeiXX320-Feb-06 13:41
AlexeiXX320-Feb-06 13:41 
QuestionDate problem Pin
sebastian yeok18-Feb-06 22:41
sebastian yeok18-Feb-06 22:41 
AnswerRe: Date problem Pin
Colin Angus Mackay19-Feb-06 0:41
Colin Angus Mackay19-Feb-06 0:41 
GeneralRe: Date problem Pin
sebastian yeok19-Feb-06 1:53
sebastian yeok19-Feb-06 1:53 
GeneralRe: Date problem Pin
Colin Angus Mackay19-Feb-06 2:19
Colin Angus Mackay19-Feb-06 2:19 
GeneralRe: Date problem Pin
sebastian yeok19-Feb-06 2:37
sebastian yeok19-Feb-06 2:37 
GeneralRe: Date problem Pin
Colin Angus Mackay19-Feb-06 2:43
Colin Angus Mackay19-Feb-06 2:43 
QuestionHow to indent SQL statements? Pin
sacoskun18-Feb-06 21:19
sacoskun18-Feb-06 21:19 
AnswerRe: How to indent SQL statements? Pin
Colin Angus Mackay19-Feb-06 0:26
Colin Angus Mackay19-Feb-06 0:26 
GeneralRe: How to indent SQL statements? Pin
CWIZO19-Feb-06 1:40
CWIZO19-Feb-06 1:40 
GeneralRe: How to indent SQL statements? Pin
Paul Conrad19-Feb-06 7:45
professionalPaul Conrad19-Feb-06 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.