As I can recommend , this is to create a table with a row for each letter in the alphabet, which will make it easier to delete letters with LEFT JOIN and GROUP_CONCAT at the end.
Without this table, you have to resort to hacking by creating a temporary โalphabet tableโ using a JOIN between a temporary variable and a table with more rows than the number of letters. In this example, I am using INFORMATION_SCHEMA.COLLATIONS.
SELECT GROUP_CONCAT(CHAR(ch) SEPARATOR '') 'missing letters' FROM (SELECT @tmp: =@tmp +1 ch FROM (SELECT @tmp:=96) a, INFORMATION_SCHEMA.COLLATIONS WHERE @tmp<122) z LEFT JOIN TableA ON ch=ORD(TableA.code) WHERE TableA.code IS NULL;
A nested SELECT constructs an alphabetical sequence; LEFT JOIN deletes the letters that exist in TableA (your table). GROUP_JOIN combines the received letters. The result is a string with all the letters that do not exist in TableA.
source share