java - (JDBC) Mysql query with if statement and multiple conditions -


what proper syntax mysql-java statement such 1 ?

preparedstatement st =connection.preparestatement("select name, value, quantity sales if (type=='purchase' , state=='confirmed') or (type=='sale' , state=='not confirmed'))  ;  

the sql like:

select name, value, quantity sales  (type = 'purchase' , state = 'confirmed') or       (type = 'sale' , state = 'not confirmed'); 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -