to retrieve those records that have salary>5000 recently(date ) and bonus >2000. i wrote stmt.executeQuery("select * from emp where sal>5000 and empid>2000") this is not working. something wrong with the statement?please let me know how to use logical operators in where clause. thanks, sri
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
It looks good to me... Try adding a ';' to the end of your sql statement. Depending upon you driver and/or db engine. The ';' may be required. hope this helps, Monty6
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
hello! bmw, u r statement is to retrieve those records that have salary>5000 recently(date ) and bonus >2000. i wrote stmt.executeQuery("select * from emp where sal>5000 and empid>2000") this is not working.
here u want to retrieve the records whosa sal > 5000 and bonus > 2000 and but in the query u have mentioned select * from emp where sal > 5000 empid > 2000") change the empid to bonus and try .,I think there is no problem with teh statement.try this and in case any probelm , let me know. satya
Apu Nahasapeemapetilon
Ranch Hand
Joined: Sep 06, 2000
Posts: 51
posted
0
satyakhjkljhkj, Good one, nothing more annoying than blaming java for your own logic flaw.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.