I have many tables, say T1, T2, T3.
Every table has a column named field. I’d like to get the maximum value of field in the three tables, but also from which table it came, for example:
T1 { 6, 8, 23 }
T2 { 8, 45, 23 }
T3 { 68, 5, 67 }
I have to get 68 knowing that it belongs to table T3. I use MySQL as DBMS.
Maybe there’s a catch I’m missing but the following seems to me a possible solution: