| |

VerySource

 Forgot password?
 Register
Search
View: 670|Reply: 3

Have a look at `big buddies?

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 17:40:01
| Show all posts |Read mode
example:
A B C
a 1 2
b 2 3
c 3 4
1d 5 6
1e 6 7
1f 8 9
Why doesn't the table become (bottom):
A B C
1a 1 2
1b 2 3
1c 3 4
1d 5 6
1e 6 7
1f 8 9
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-3 17:42:01
| Show all posts
select A = '1' + right (A, 1) form yTable
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-1-4 16:09:01
| Show all posts
create table T (A varchar (10), B int, C int)
insert T select 'a', 1, 2
union all select 'b', 2, 3
union all select 'c', 3, 4
union all select '1d', 5, 6
union all select '1e', 6, 7
union all select '1f', 8, 9

update T set A = '1' + A
where charindex ('1', A) <> 1

select * from T

--result
A B C
---------- ----------- -----------
1a 1 2
1b 2 3
1c 3 4
1d 5 6
1e 6 7
1f 8 9

(6 row (s) affected)
Reply

Use magic Report

1

Threads

7

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-4 16:21:01
| Show all posts
update on the table
set on the table. A = '1' + A
where substring (A, 1,1) <> '1'
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