1

以下は私のクエリです、このクエリは私に次のエラーを与えていますUnknown column 'package_id' in 'where clause

insert into company_packages(
     package_product_id
    ,product_id
    ,company_id
    ,user_id
    ,expiry_date
    ,discount) 
values(
     (select id from package_products 
     where package_id=1 and product_id=5 and status=1 limit 1)
    ,5
    ,111
    ,116
    ,'2015-06-10'
    ,0)

しかし、この内部クエリを実行すると、エラーは発生しません

select id from package_products 
where package_id=1 and product_id=5 and status=1 limit 1
4

2 に答える 2