| |

VerySource

 Forgot password?
 Register
Search
View: 686|Reply: 5

Is there such a strange thing? ? !! !! Anxious, expert help

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-22 23:00:01
| Show all posts |Read mode
I can't perform "
update spmsb set jhdj = (convert (numeric (20,4), a.xykc * jhdj)--1 * 17) / (a.xykc- -1) from spmsb,
(select spkcb.spidh as spidh, sum (xykc) as xykc from SPKCB, spmsb
where SPKCB.spidh = spmsb.spidh and spkcb.spidh = 3158 group by spkcb.spidh) a
Where spmsb.spidh = a.spidh ", but it can be executed in SQL. Please help experts
Reply

Use magic Report

0

Threads

14

Posts

14.00

Credits

Newbie

Rank: 1

Credits
14.00

 China

Post time: 2020-5-6 16:15:01
| Show all posts
convert (numeric (20,4), a.xykc * jhdj)--1 * 17
It is better to put brackets in some places
Is the burden reduced by 1 * 17?
The same statement will be executed in SQL execution VB
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-5-7 22:15:01
| Show all posts
Are the brackets the same? It's wrong to add brackets
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 Invalid IP Address

Post time: 2020-5-8 11:00:01
| Show all posts
dizzy.
Never tried this update
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-5-11 22:45:01
| Show all posts
Prompted by zero division error, but I checked the database a.xykc = 0, jhdj = 17
Reply

Use magic Report

0

Threads

6

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-6 17:45:02
| Show all posts
Write in VB:
Data source.Execute "update spmsb set jhdj=(convert(numeric(20,4),a.xykc*jhdj)- (-1*17))/(a.xykc- (-1)) from spmsb
inner join (select spkcb.spidh as spidh,(case when sum(xykc)=-1 then 0 else sum(xykc) end )as xykc from SPKCB inner join spmsb
on SPKCB.spidh=spmsb.spidh and spkcb.spidh=3158 group by spkcb.spidh) a
on spmsb.spidh = a.spidh "
It should be possible, I often write UPdate like this, to ensure that (a.xykc- (-1)) <>0
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