In Java I have a defined a string named year:
String year="year(now())-1"
Now I want the value of this string to be subsituted below using where like clause:
ResultSet rs = stmt.executeQuery("select abc from table where year like '"+year+"' " )
But using above statement I get no result.
Can anyone please tell where I am going wrong?
To minus 1 year
So you can use
Final: