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 8737417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:31:03+00:00 2026-06-13T10:31:03+00:00

I’m trying to insert records from other tables into store_orders_items. For example: INSERT INTO

  • 0

I’m trying to insert records from other tables into store_orders_items.
For example:

INSERT INTO store_orders_items( order_id, sel_item_id, sel_item_price)
  SELECT order_id, sel_item_id, sel_item_price
      FROM orders_ids 
      INNER JOIN store_orders ON store_orders.id = orders_ids.order_id
      INNER JOIN store_shoppertrack ON  store_items.id=store_shoppertrack.sel_item_id
      Where session_id = '".$_COOKIE["PHPSESSID"]."';

Then I received the following message: Unknown column ‘sel_item_price’ in ‘field list’. I tried to set sel_item_price As item_price to no avail.
Here are my tables:

store_orders_items:

id| order_id | sel_item_id |sel_item_price|  
-------------------------------------------        
  |          |             |              |

store_shoppertrack:

id| session_id | sel_item_id |date_added|  
-------------------------------------------        
  |            |             |          |

store_orders:

id| item_total| order_date| 
---------------------------       
  |            |          |

store_items:

id| item_price| item_color|  
---------------------------       
  |           |           |  

orders_ids:

id| order_id | status|  
----------------------       
  |          |       |   
  • 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-13T10:31:04+00:00Added an answer on June 13, 2026 at 10:31 am

    There is no table in jour join which has either a column named sel_item_price, nor a column item_price. The INSERT INTO has nothing to do with this, the SELECT on its own will fail just as well. I assume that you wanted to join with the store_items table as well, and select the item_price column from that table for insertion into the sel_item_price table of store_order_items. You could rewrite your SELECT like this:

    SELECT order_id, store_shoppertrack.sel_item_id, store_items.item_price AS sel_item_price
      FROM orders_ids 
      INNER JOIN store_orders ON store_orders.id = orders_ids.order_id
      INNER JOIN store_items ON store_items.id = store_orders.sel_item_id
      INNER JOIN store_shoppertrack ON  store_items.id=store_shoppertrack.sel_item_id
      Where session_id = 'foo';
    

    The AS sel_item_price is optional, since you already specified the destination column in the INSERT INTO part. But it might help consistency, as the output of the SELECT will now hace volumns labeled the same as those of the target table. And it exhibits that you got the order of the AS wrong in your question, so you might learn something here.

    I’ve created a SQL Fiddle for your schema and query.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,

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.