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. how can I get maximum values from set of alphanemeric field [modified]

how can I get maximum values from set of alphanemeric field [modified]

Scheduled Pinned Locked Moved Database
helpquestion
2 Posts 2 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.
  • S Offline
    S Offline
    snehasish
    wrote on last edited by
    #1

    Hi; I create a field(namely Id) which have two types(09a.. or 09b..) of alphanumeric value like; Id 09a1001 09a1002 09b1001 09b1002 09b1003 from these numbers at time a i need maximum value of 09a (it will be 09a1002) series or maximim value of 09b series(it will be 09b1004). Help me.

    modified on Thursday, January 29, 2009 7:57 AM

    W 1 Reply Last reply
    0
    • S snehasish

      Hi; I create a field(namely Id) which have two types(09a.. or 09b..) of alphanumeric value like; Id 09a1001 09a1002 09b1001 09b1002 09b1003 from these numbers at time a i need maximum value of 09a (it will be 09a1002) series or maximim value of 09b series(it will be 09b1004). Help me.

      modified on Thursday, January 29, 2009 7:57 AM

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      You could have something like:

      select max(convert(int, substring(id, 4, 9999)))
      from tablename
      where id like '09a%'

      The need to optimize rises from a bad design.My articles[^]

      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