File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
JDBC and Relational Databases
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
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" ;
author & internet detective
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?
OCA 8 book
How To Ask Questions The Smart Way
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: Union of mysql statement
SQLException beteen correlation and exposed name
Jsp Login Page Problem
Oracle Pivot table
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015