How can I find out the min/max value form multiple tables?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ramya12
    New Member
    • Nov 2014
    • 1

    How can I find out the min/max value form multiple tables?

    I have three tables with each table having only one column that is ID column. I want to find out the maximun id out of the three tables. Pleas help me in this.

    Thanks,
    Ramya
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Union the tables together and take the max of that.

    Comment

    • Luuk
      Recognized Expert Top Contributor
      • Mar 2012
      • 1043

      #3
      depending on the size of the three individual tables, it might be faster to find the min/max of each table and union that result to find min/max of all three tables.

      Comment

      Working...