Solved

joning tables

Posted on 2004-09-20
7
246 Views
Last Modified: 2010-04-06
Hi

I am writing a stored proc and it has two select statements.

wht i need is how to combine the two tables that are returned from the two select statements and display the combined table in the datagrid. Both the select statment tables have same data types. and the statements are parameterized statements. so i am not able to use the 'View' in this context.

is there any other possible solution for this.

Thanks
sandeep
0
Comment
Question by:sandeep437
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 21

Expert Comment

by:MogalManic
ID: 12107645
What web language are you using?
0
 

Author Comment

by:sandeep437
ID: 12108012
SQL server 2000
0
 
LVL 21

Expert Comment

by:MogalManic
ID: 12108663
If the two tables are in the same database, you can just join the two tables with a select statement:

SELECT publishers.name, publishers.id, books.title
        FROM publishers INNER JOIN books ON publishers.id = books.publisher_id


The above SQL joins Publishers table with books table.
0
 
LVL 2

Accepted Solution

by:
variant7 earned 250 total points
ID: 12110163
I think a UNION query will do the trick for you :

SELECT t1.field1 AS fld1, t1.field2 AS fld2 FROM table1 AS t1
UNION
SELECT t2.otherfield1 AS fld1, t2.otherfield2 AS fld2 FROM table2 AS t2
0
 

Author Comment

by:sandeep437
ID: 12111851
Hi Variant7

       yeah. UNION is working good in this situation.

thanks

sandeep
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question