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. sql code problem Help pls

sql code problem Help pls

Scheduled Pinned Locked Moved Database
helpdatabase
4 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.
  • T Offline
    T Offline
    TALHAKOSEN
    wrote on last edited by
    #1

    Hi all, i know maybe its is really easy but I've been working on it for ages ! ( Name Diploma year A 1991 A 1986 A 1981 B 2001 B 1996 B 1992 C 1990 C C D 2006 D D i have a 3-4 tables and join them, then it returns lots of people have diplomas from different school, but i need to show the last graduated school for everyone. like that A 1991 B 2001 C 1990 D 2006 . . . . . thanks for now ... Talha

    thanks for everything i have...

    B 1 Reply Last reply
    0
    • T TALHAKOSEN

      Hi all, i know maybe its is really easy but I've been working on it for ages ! ( Name Diploma year A 1991 A 1986 A 1981 B 2001 B 1996 B 1992 C 1990 C C D 2006 D D i have a 3-4 tables and join them, then it returns lots of people have diplomas from different school, but i need to show the last graduated school for everyone. like that A 1991 B 2001 C 1990 D 2006 . . . . . thanks for now ... Talha

      thanks for everything i have...

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      select max(diplomayear),[name]
      from mytable
      group by [name]

      Hope this will help you.


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

      T 1 Reply Last reply
      0
      • B Blue_Boy

        select max(diplomayear),[name]
        from mytable
        group by [name]

        Hope this will help you.


        I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

        T Offline
        T Offline
        TALHAKOSEN
        wrote on last edited by
        #3

        thank you, it works !

        thanks for everything i have...

        B 1 Reply Last reply
        0
        • T TALHAKOSEN

          thank you, it works !

          thanks for everything i have...

          B Offline
          B Offline
          Blue_Boy
          wrote on last edited by
          #4

          No problem.


          I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

          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