The following table shows the combinations of data types that can be compared in the search condition specified in the WHERE or HAVING clause. For details about the WHERE clause, see 4.4.6 WHERE clause. For details about the HAVING clause, see 4.4.8 HAVING clause.
The comparison rules explained here also apply to the GROUP BY clause and aggregate functions.
Table 3-8 Combinations of data types that can be compared
No. | Data type | Numeric data | Character data | Date data | Time data | Timestamp data |
---|---|---|---|---|---|---|
1 | Numeric data | Y | D | N | N | N |
2 | Character data | D | Y | D | D | D |
3 | Date data | N | D | Y | N | N |
4 | Time data | N | D | N | Y | N |
5 | Timestamp data | N | D | N | N | Y |