| |

VerySource

 Forgot password?
 Register
Search
View: 921|Reply: 7

Brother is waiting for an answer here.

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-7 10:20:01
| Show all posts |Read mode
update data set description
=
select left (description, charindex ('<Br>', description) -1) as description from data where num in (
 select num from data
where description like '% <Br>%')

where where description like '% <Br>%'


I mean, modify the description to the query, but I can't write it like this, why?
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-7 12:12:01
| Show all posts
Because the subquery has multiple values
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-7 12:21:01
| Show all posts
Try:

update data set description
= left (description, charindex ('<Br>', description) -1)
where description like '% <Br>%'
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-1-7 12:48:01
| Show all posts
update data set description = left (description, charindex ('<Br>', description) -1)
where description like '% <Br>%'
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-1-7 13:03:01
| Show all posts
--try

update data set description = left (description, charindex ('<Br>', description) -1)
from data
where charindex ('<Br>', description)> 0
Reply

Use magic Report

0

Threads

100

Posts

53.00

Credits

Newbie

Rank: 1

Credits
53.00

 China

Post time: 2020-1-7 13:09:01
| Show all posts
update data set description
=
select left (description, charindex ('<Br>', description) -1) as description from data where num in (
select num from data
where description like '% <Br>%')

where where description like '% <Br>%'
-----------
Can there be two consecutive where there is no problem!
Reply

Use magic Report

0

Threads

66

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 China

Post time: 2020-1-7 13:21:01
| Show all posts
Sharp upstairs. . . No one saw it. . .
Reply

Use magic Report

1

Threads

13

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-8 14:54:01
| Show all posts
update data set description
=
select left (description, charindex ('<Br>', description) -1) as description from data where num in (
select num from data
where description like '% <Br>%')
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