Home > Back-end >  SQL statement to determine gender in page shows garbled, thanks to the warrior guidance!!!!!! thank
SQL statement to determine gender in page shows garbled, thanks to the warrior guidance!!!!!! thank

Time:11-22

Database using the mysql database, sex field definition is type TINYINT default 20 size


The background SQL statements below
String SQL="select ti. User_id as' user_id ',"
+ "ti user_name as" user_name ", "
+ "(CASE WHEN ti. User_sex=0 THEN 'no choice'
"+ "the WHEN ti. User_sex=1 THEN 'male'"
+ "the WHEN ti. User_sex=2 THEN 'female'"
+ "ELSE" '
"+ "END) as' user_sex,"
+ "ti user_mail as' user_mail ',"
+ "ti user_tel as' user_tel,"
+ "ti user_address as' user_address,"
+ "ti user_create_time as' user_create_time ',"
+ "ti user_rank_id as' user_rank_id ',"
+ "ti user_dept_id as' user_dept_id '"
+ "from t_user_info ti";

The JSP page (pageEncoding (GBK and utf-8 are used))
Use & lt; Logic: iterate> The tag

CodePudding user response:

The ${user. User_sex}?

CodePudding user response:

This refers to a page you? If is on the page, through the iterative array take data collection (including user_sex attributes of the entity class)

CodePudding user response:

And see if it is caught in the database code is inconsistent
  • Related