MySQL在比較字元時無法執行區分大小寫的比較。可以透過以下來自表格'Employee'的範例來說明:
mysql> Select * from Employee; +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 2 | Rahul | 20000 | | 3 | Advik | 25000 | | 4 | Aarav | 65000 | | 5 | Ram | 20000 | | 6 | Mohan | 30000 | | 7 | Aryan | NULL | | 8 | Vinay | NULL | +----+--------+--------+ 8 rows in set (0.09 sec)
以下查詢的結果集顯示MySQL在比較字元時不區分大小寫。
mysql> Select * from Employee WHERE Name IN ('gaurav','RAM'); +----+--------+--------+ | ID | Name | Salary | +----+--------+--------+ | 1 | Gaurav | 50000 | | 5 | Ram | 20000 | +----+--------+--------+ 2 rows in set (0.00 sec)
以上是MySQL 可以執行什麼樣的字串比較(區分大小寫或不區分大小寫)?的詳細內容。更多資訊請關注PHP中文網其他相關文章!