Changing concat to union in sql query