bash is used (otherwise, pre-sort the input files with
sort -o List1 List1 and
sort -o List2 List2 and use
List1 List2 instead of the process substitutions):
$ join -t, -v1 <( sort List1 ) <( sort List2 )
This does a relational JOIN operation between your two files, sorting their contents first. The
join to treat commas as the field delimiter, and with
-v1 we ask for the entries in the first file that does not join with any entry in the second. The join happens by default on the first field of each file.
To strip off the last integer from this:
join -t, -v1 <( sort List1 ) <( sort List2 ) | sed 's/[0-9]*$//'
For a MySQL solution, you would have had to provide the SQL schema for the involved tables, but the resulting query would have looked something like
SELECT * FROM table1 WHERE joinfield1 NOT IN (SELECT joinfield2 FROM table2);