Interviews4 answers
How to return Data from 4 Different tables in Stored Procedure with out using joins?
4 Answers
Union , Union all
uma sankarPosted Apr 28, 2015, 11:44 PM EDT
For selecting columns without join just do like this.
Select table1.FieldName,table2.FieldName from table1,table2.
Or if you want to take only common fields from different tables without joins do like this.
select table1.fieldname, table2.fieldname from table1, table2 where table1.commonfiledname = table2.commonfieldname
ankit dwivediPosted Sep 7, 2014, 11:54 PM EDT
if you want to get single value from each table like sum or count of a column then you can do this like-
select
(
(select count(*) from table 1) A,
(select count(*) from table 2) B,
(select count(*) from table 3)C,
(select count(*) from table 4) D
)
It will give the Single row with 4 columns named A,B,C and D
Rahul BansalPosted Aug 10, 2014, 9:58 PM EDT
you can return multiple values from stored procedure, eg.
http://www.aspdotnet-suresh.com/2012/07/create-stored-procedure-to-return.html
And, May I ask you why not using Joins?
Guest UserPosted Aug 1, 2014, 7:12 PM EDT

