Showing posts with label procedurelike. Show all posts
Showing posts with label procedurelike. Show all posts

Friday, February 24, 2012

add columns from two queries

Hello all

im trying to add the the columns resulted from one query to other columns resulted from other query in a stored procedure

like this

select x1,x2,x3 from Table1
select x4,x5 from table

i want to put it like this

x1 x2 x3 x4 x5

:)

i really need this helpp

thank youuuYou need to use a join. From what you've posted I can't tell which fields relate the records in one table to the records in another. But it would look something like this:


Select Table1.x1,Table1.x2,Table1.x3, Table.X4, Table.X5
FROM Table1 inner join Table on (Table1.JoinField=Table.OtherJoinField)