I have the MySQL table with 2 rows that is “name” for user name and “port” for user port.
i want to get port number from port row when i get some condition,
example: i want to get Louis’ port number if nama = Louis
NOTE: I use JDBC
What MySQL command should I use?
I’ve tried this command (below) but still failed:
ResultSet rslset = statement.executeQuery("select cast(case when
nama='"+name+"') port from user");
NOTE: Variable “name” is the name that will be checked
1 Answer