Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9144551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:17:50+00:00 2026-06-17T10:17:50+00:00

Im looking to add all products that dont have attribute_id = 12 into oc_product_attribute

  • 0

Im looking to add all products that dont have attribute_id = 12 into oc_product_attribute,

But getting a syntax error…

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 ’12) select ocp.product_id from oc_product ocp where ocp.product_id not in (SE’ at line 1

insert into `oc_product_attribute` (ocp.product_id, 12)  
select ocp.product_id from oc_product ocp where ocp.product_id not in (SELECT oca.`product_id`
FROM `oc_product_attribute` oca where oca.attribute_id = 12)

Am I missing something here, quite new to SQL.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T10:17:52+00:00Added an answer on June 17, 2026 at 10:17 am

    Usually you have to enumerate columns in insert statements.

    insert into `oc_product_attribute` (ocp.product_id, 12)  
    

    must be

    insert into `oc_product_attribute` (ocp.product_id, some_column_name)  
    

    and I guess it may be attribute_id.

    For more details, please see the reference manual -> http://dev.mysql.com/doc/refman/5.6/en/insert-select.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three products listed on a single page and I'm looking to add
All, I am looking for a way to add an OCS presence icon the
I am looking to add a local database file (.sdf) into my .NET Project.
I'm looking to add a textbox on my website that captures a single email
I am looking to add the Google Map API to my own website, but
So let's say I have an ArrayList full of Products that need to be
I'm looking to write an application. Think e-commerce. But think, an e-commerce site that
I have a PHP/MySQL e-commerce site that is placing order detail information into a
I am getting json data. In that json I have a url for an
I'm looking to add a _ _ in the Array variable for each of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.