MySQL Error: Column 'num' in where clause is ambiguous