Try this...

SELECT COUNT(DISTINCT A||B) FROM TABLE;