Home > database >  Merge database stored procedures
Merge database stored procedures

Time:09-18

How to make the stored procedure in two query fields appear on a line

CodePudding user response:

What do you mean?

Select * from (select aaa, BBB from a union all select, BBB, CCC from b) c
So that you can put A table and B table field shows that, however, the number of fields in the subquery must agree, if A table field, A field, ' 'can be used AS XXX complement

CodePudding user response:

This is very simple,

Proc first written to a temporary table, or table variable,

With a recursive cte structure to query, will be two lines parallel processing,
Or to use temporary tables and set way can

CodePudding user response:

Post your actual table structure, said doesn't make sense out of thin air

CodePudding user response:

And the test data and the desired results

CodePudding user response:

reference 1st floor netcup response:
what do you mean?

Select * from (select aaa, BBB from a union all select, BBB, CCC from b) c
So that you can put A table and B table field shows that, however, the number of fields in the subquery must agree, if A table field, A field, ' 'can be used AS XXX complement

If you call a stored procedure need time parameters inside how to write

CodePudding user response:

reference 5 floor barbie bear reply:
Quote: refer to 1st floor netcup response:
what do you mean?

Select * from (select aaa, BBB from a union all select, BBB, CCC from b) c
So that you can put A table and B table field shows that, however, the number of fields in the subquery must agree, if A table field, A field, ' 'can be used AS XXX complement

If you call a stored procedure need time parameters inside how to write
time parameter? Don't understand, you are a complete account of what you need,

CodePudding user response:

Clarify requirements, the easiest to use excel to draw once, your source data looks like, what is the expected results,

CodePudding user response:

Can only use a temporary table to receive, then joining together
  • Related