| |

VerySource

 Forgot password?
 Register
Search
View: 927|Reply: 6

Simple temporary table problem, but confused

[Copy link]

2

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-9 16:00:01
| Show all posts |Read mode
I use:
declare @t table (S_DATA int, S_TIME int, S_ID int)
select * into @t from text_one

instead:
insert @t
select 3, 12, null union all
select 2, 13, null union all
select 2, 14, null union all

Tip: There is an error near "@t", please solve it for me ~ Thank you
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-10 21:15:01
| Show all posts
The number of columns is different, brother
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-8-10 21:30:01
| Show all posts
Use insert into...select for existing tables.
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-8-10 21:45:01
| Show all posts
--Less the list
Reply

Use magic Report

0

Threads

40

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 Korea, Republic of

Post time: 2020-8-10 22:00:02
| Show all posts
. . . .
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-8-10 22:15:01
| Show all posts
--wrong

declare @t table(S_DATA int,S_TIME int,S_ID int)
insert @t select * from text_one
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-8-10 23:00:01
| Show all posts
declare @t table(S_DATA int,S_TIME int,S_ID int)
insert @t select * from text_one
- Is the text_one table three columns?
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list