Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. return max value from column [modified]

return max value from column [modified]

Scheduled Pinned Locked Moved Database
databasehelptutorialquestion
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reshsilk
    wrote on last edited by
    #1

    hello, does anybody know how to write a query that returns the maximum value of a column? here is what i have so far: SELECT barcode, wellname, well.ph, proteinname, score, time FROM well INNER JOIN welldrop ON well.wellkey=welldrop.wellkey INNER JOIN imageset ON welldrop.dropkey=imageset.dropkey WHERE well.barcode=1111 this query returns several rows for each "wellkey". i only want to return one row for each wellkey, with the most recent date (found in the time field of the imageset table). i tried using MAX(time), but i got an error... thanks! RC -- modified at 17:20 Wednesday 28th June, 2006

    R 1 Reply Last reply
    0
    • R reshsilk

      hello, does anybody know how to write a query that returns the maximum value of a column? here is what i have so far: SELECT barcode, wellname, well.ph, proteinname, score, time FROM well INNER JOIN welldrop ON well.wellkey=welldrop.wellkey INNER JOIN imageset ON welldrop.dropkey=imageset.dropkey WHERE well.barcode=1111 this query returns several rows for each "wellkey". i only want to return one row for each wellkey, with the most recent date (found in the time field of the imageset table). i tried using MAX(time), but i got an error... thanks! RC -- modified at 17:20 Wednesday 28th June, 2006

      R Offline
      R Offline
      reshsilk
      wrote on last edited by
      #2

      i think i figured it out. the following serves my purposes: SELECT barcode, wellname, well.ph, proteinname, score, MAX(time) AS time FROM well INNER JOIN welldrop ON well.wellkey=welldrop.wellkey INNER JOIN imageset ON welldrop.dropkey=imageset.dropkey WHERE well.barcode=1111 GROUP BY barcode,wellname

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups