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. Please help on SQL Query

Please help on SQL Query

Scheduled Pinned Locked Moved Database
databasehelp
5 Posts 3 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.
  • P Offline
    P Offline
    Pankaj Joshi
    wrote on last edited by
    #1

    Hello Experts, Suppose I have three fields in table named ID,Order Date and Order NO. I have to fetch the max order no along with their Id and date. actually I have more than 1000 records on a particular date. So I have to fetch max order no and max order date..... Please help

    Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

    K 1 Reply Last reply
    0
    • P Pankaj Joshi

      Hello Experts, Suppose I have three fields in table named ID,Order Date and Order NO. I have to fetch the max order no along with their Id and date. actually I have more than 1000 records on a particular date. So I have to fetch max order no and max order date..... Please help

      Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

      K Offline
      K Offline
      Kishore P
      wrote on last edited by
      #2

      try like: select max(OrderNo), max(orderDate) from

      P 1 Reply Last reply
      0
      • K Kishore P

        try like: select max(OrderNo), max(orderDate) from

        P Offline
        P Offline
        Pankaj Joshi
        wrote on last edited by
        #3

        That is not working properly. I want to know max order date first and after that what is the max order no on that particular date. Please help.:confused:

        Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

        D 1 Reply Last reply
        0
        • P Pankaj Joshi

          That is not working properly. I want to know max order date first and after that what is the max order no on that particular date. Please help.:confused:

          Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

          D Offline
          D Offline
          Devan Nadar
          wrote on last edited by
          #4

          Hi, Use this query... select id ,ord_num, ord_Date from where ord_num = (select max(ord_num) from where ord_Date =(select max(ord_Date) from )) :)

          P 1 Reply Last reply
          0
          • D Devan Nadar

            Hi, Use this query... select id ,ord_num, ord_Date from where ord_num = (select max(ord_num) from where ord_Date =(select max(ord_Date) from )) :)

            P Offline
            P Offline
            Pankaj Joshi
            wrote on last edited by
            #5

            Thank you for reply.

            Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

            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