Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger

Sql statement

Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All..

I have been struggling with this code for 3 hours now,can you please help.this code is hard coded and i need to unhard code it,so here is the code please help.

select staticdata.descr as deptname,appraisal.state as appraisalPhase,appraisal.lastupdated,appraisal.scoreunitid
from appraisal
left JOIN hruser on hruser.userid = appraisal.appraisee
LEFT JOIN staticdata on = hruser.deptname
where appraisal.lastupdated > "1999/01/01"
AND appraisal.lastupdated < "2009/01/01"
AND in ("1179991863437762177185","123539977081431915490412353998213101873543512353999380021949703600")
group by hruser.deptname

Thank you.
Posts: 43016
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "un-hardcode" it? What are you trying to do with this query?
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume he wants to be able to change parameters dynamically...

If this is what you want Shumani you can do it with PreparedStatement.
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
    Bookmark Topic Watch Topic
  • New Topic