raj raj

raj raj

  • 1.4k
  • 256
  • 16.9k

get the highest id value from second table in sql server

Jul 31 2023 5:42 AM

I have table t1 in sql server and table t2.

t1 have id,status column and t2 have id and  matchid 2 column.

t1 table we have 2 record 

id status

1  active

1 inactive

and t2 table also have 2 record 

id    matchid

2     1

32   1

we want output like 

1    32

in second table need to pick max id 


Answers (4)