PostgreSQL LIKE 大小写

PostgreSQL 数据库

函数upper(“字符串”):转成大写字符串

WHERE  UPPER("User_Name") LIKE upper(username) 此句查询“User_Name” 中值大小写不区分。


SELECT "User_Id","User_Image","User_Name","User_Birthday","User_Sex","User_OnlineLat","User_OnlineLon","User_State",

(SELECT COUNT(*) FROM "tbUsers" WHERE UPPER("User_Name") LIKE upper(username)) AS "user_count"
FROM "tbUsers" 
WHERE UPPER("User_Name") LIKE upper(username) LIMIT 10 OFFSET 0;

你可能感兴趣的:(PostgreSQL)