This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes insertion with condition query Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "insertion with condition query" Watch "insertion with condition query" New topic

insertion with condition query

rajesh mahendran

Joined: Feb 17, 2013
Posts: 9
I fetched both the values total and reg and i need to know that how to insert a query with checking it with the condition

anyone help thanks in advance
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

I don't think that's valid SQL. The bad part is, I don't even understand what you want to do with it. Perhaps you could start by explaining that. For example: what's "regno"? A database column? A Java variable?
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Paul Clapham wrote:I don't think that's valid SQL. ...

True. A where statement only works (and only makes sense) on existing rows. And insert is used to add a new row. The two contradict each other.

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: insertion with condition query
It's not a secret anymore!