Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in where clause

 
gaurav chhabra
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir
i m using the query....

String q1 = "select id from experience where years =" + name1 & "months ="+name2 ;

it is givig error at "&".plz tell me the exact query....
thank you
gaurav
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gaurav chhabra:


String q1 = "select id from experience where years =" + name1 & "months ="+name2 ;

it is givig error at "&".plz tell me the exact query....



gaurav '&' is used in VB I think

This should be something like

 
Anandh Ramesh
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

the '&' symbol is not supported by sql. use the word 'and' instead...

all the best...
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!