table1:
id vname
============
100 veh1
200 veh2
table2: id name ============= 100 "James" 200 "tammy" 100 "john" 100 "cindi" 200 "angie"I am trying to get max value from table2 "name" column for each vname in table1 using sql statement. Here is the statement that I did but it didn't produce right results.
SELECT Table1.id. Table1.vname, max(Table2.name); FROM fleet!table1 INNER JOIN fleet!table2 ; ON Table1.id = Table2.idI need the results to be
100 veh1 "cindi" 200 veh2 "angie"I'm I doing the max wrong on characters? What is the correct way to do it.