gpt4 book ai didi

mysql - SQL错误(参数太少)

转载 作者:行者123 更新时间:2023-11-29 18:09:57 24 4
gpt4 key购买 nike

select productline, P.productcode, productname, (OD.priceeach - P.buyprice) as ProfitMargin
from Products P, OrderDetails OD
where P.productcode = OD.productcode and productline like '%Cars%'
order by ProfitMargin desc

当我运行它时,出现错误。它显示“参数太少。预期为 1。”我的代码有什么问题吗?

最佳答案

在 Microsoft Access 中构建查询时,可以通过在 SQL 语句中插入用方括号括起来的参数名称来使用“参数”。当然,您也可以将字段(或表)的名称放在方括号中;方括号的解释有些含糊。

Access 将首先在字段名称中搜索方括号内的名称,然后在表名称中搜索,只有在这些列表之一中找不到该名称时,才会将该名称视为参数名称。

关于mysql - SQL错误(参数太少),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47487849/

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