A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Android Security Essentials Live Lessons
this week in the
Union of mysql statement
Joined: May 13, 2011
Nov 13, 2011 10:35:20
Is it possible to get the result of two sql statements by using keyword "Union" in Java like this...
If yes, can you tell me how to do that.
String sql = "Select * from tblUsers , tblRoles where tblUsers.tblRoles_id = tblRoles.id and tblRoles.id = 1"+ "Union"+ "Select * from tblUsers , tblRoles where tblUsers.tblRoles_id = tblRoles.id and tblRoles.id = 2" ;
Joined: May 26, 2003
Nov 13, 2011 10:55:06
Yes. Except for the missing space before and after the "union" keyword, it looks right. What error do you get?
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
subject: Union of mysql statement
Jsp Login Page Problem
Oracle Pivot table
SQLException beteen correlation and exposed name
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014