sql SELECT query with certain conditions

MrMohammad

New Member
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 JDBCWhat MySQL command should I use?I've tried this command (below) but still failed:\[code\] ResultSet rslset = statement.executeQuery("select cast(case when nama='"+name+"') port from user");\[/code\]NOTE: Variable "name" is the name that will be checked
 
Top