Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2011
    Posts
    3

    Unanswered: returning max count value

    basically I have a table of titles with columns: pubdate, pub_id, and title_id. I want to write a query that will return the pub_id with the most pubdate. And pubdate is a date datatype.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Select pub_id
    from titles
    where pubdate = (select max(pubdate) from titles);
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Dec 2011
    Posts
    3
    I meant the highest count of pubdates.

    Quote Originally Posted by anacedent View Post
    Select pub_id
    from titles
    where pubdate = (select max(pubdate) from titles);

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >I meant the highest count of pubdates.
    I apologize for not reading your mind.
    I suggest you extrapolate a solution or live & learn.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Dec 2011
    Posts
    3
    np. tanx for the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •