How to store the results of a SELECT query in an existing table?
-
I am doing a database project for my IT A-Level and I need to create an electronic register. I have a query that does work, it searches through a table where the Students are assigned to Classes (uniquely identified by an Assign ID) by a Class ID that the user enters into a search parameter box on running the query. I want to store all of the Assign IDs that are displayed in the query into a register table which will then be used to display all of the Students in the Class onto a Register Form so I can store their attendance. I'm using OpenOffice and I've been trying to use an SQL INSERT to store the data but it isn't working. What would an appropriate SQL command be that would store the Assign IDs from the existing query to the register table?
-
Answer:
Use INSERT ... SELECT sytnax: http://www.sql-tutorial.ru/en/book_operator_insert.html
Tom Williams at Yahoo! Answers Visit the source
Other answers
Your syntax error is likely in the specification of Assign ID, either in the subselect or the insert (or more likely, both)
Related Q & A:
- How to modify a schema.xml of an existing list?Best solution by SharePoint
- how to create a virtual image of an existing system?Best solution by Ask Ubuntu
- How to store table with a large number of fields?Best solution by Stack Overflow
- How can store sqlplus query in a file in formatted manner and display it to console?Best solution by Stack Overflow
- How do I add a new stock to an existing portfolio?Best solution by chegg.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.