pradeepcalls Posted March 24, 2014 Share Posted March 24, 2014 Hi Guys,I am having 2 table and I have joined the 2 tables.Say Table1 - Col_id, Col_OrderedByName, Col_Name_ProductNameSay Table2 - Col_id, Col_ProductNameMy SQL: select t1.*, t2.* from Table1 t1 left join Table2 t2 on t1.col_Name_ProductName = t2.Col_idProblem: When I write this SQL in iReport designer, I am only getting the following columnsCol_id, OrderedByName, col_Name_ProductName,Col_ProductNameNow, i am missing Col_Id from Table2, is it possible to get Col_Id from Table2 without using Aliases.RegardsPradeep Link to comment Share on other sites More sharing options...
rsuddhala Posted March 24, 2014 Share Posted March 24, 2014 Hi Pradeep,Insted of t1.* or t2.* write all column names you will get example select t1.Col_Id, t2.Col_Id,t1.OrderedByName from Table1 t1 left join Table2 t2 on t1.col_Name_ProductName = t2.Col_id Link to comment Share on other sites More sharing options...
ybablyuk Posted March 24, 2014 Share Posted March 24, 2014 Hello, query should be like thisselect t1.Col_id as t1_col_id, t1.Col_OrderedByName, t1.Col_Name_ProductName, t2.Col_id as t2_col_id, t2.Col_ProductName from Table1 t1 left join Table2 t2 on t1.col_Name_ProductName = t2.Col_id Link to comment Share on other sites More sharing options...
pradeepcalls Posted March 24, 2014 Author Share Posted March 24, 2014 Thanks for your kind response. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now