gpt4 book ai didi

mysql - 计算买入价的 10% 利润

转载 作者:行者123 更新时间:2023-11-29 20:38:58 27 4
gpt4 key购买 nike

我有这个脚本计算利润

步骤:

  • barangbeli = 哈萨特/直径
  • p1 = 巴朗贝利 * 10
  • p2 = 教授/100
  • 结果 = barangbeli + 利润;

谢谢

CREATE VIEW tbkeluar as 
SELECT mbarang.kdbrg, mbarang.nmbrg, mbarang.spek,if(SUM(bkeluar.qty), SUM(bkeluar.qty), 0)as qty,(tbmasuk.harsat/mbarang.diameter) as hargabeli, ((hargabeli*10)/100 )+hargabeli) as profit
LEFT JOIN bkeluar on mbarang.kdbrg = bkeluar.kdbrg group by mbarang.kdbrg

我有错误

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') as profit from mbarang
LEFT JOIN bkeluar on mbarang.kdbrg = bkeluar.kdbrg gro' at line 2

最佳答案

您收到的错误消息应该足以帮助您了解问题所在。

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') as profit from mbarang LEFT JOIN bkeluar on mbarang.kdbrg = bkeluar.kdbrg gro' at line 2

根据错误消息,MySQL 表示由于此字符 ),您有一个语法错误,并为您附加了一些字符找到它:)作为 mbarang 的利润

正如您从 SELECT 语句中看到的,您有一个额外的 )

SELECT  mbarang.kdbrg
, mbarang.nmbrg
, mbarang.spek
,if(SUM(bkeluar.qty), SUM(bkeluar.qty), 0)as qty
,(tbmasuk.harsat/mbarang.diameter) as hargabeli
, ((hargabeli*10)/100 )+hargabeli) as profit
^ delete this extra parenthesis

关于mysql - 计算买入价的 10% 利润,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38690112/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com