sandeep437
asked on
joning tables
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
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
What web language are you using?
ASKER
SQL server 2000
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.
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.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Variant7
yeah. UNION is working good in this situation.
thanks
sandeep
yeah. UNION is working good in this situation.
thanks
sandeep