Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have a simple table 'MyCombs' with 3 columns. ID, Start & End. ID is autoincrement so I have no problem with that. For Start & End points, I have 1million records. These records are different. I have created Insert queries for these 1 miilion records. Now i am facing a problem. When i try to simply run the queries by copying 50,000 records each time in phpMyAdmin, it does not insert these records in table. Loading, Loading. I saw some solution where we have to create a sql format file. I tried but was not able to create such file. Fairly saying, i am completely new to this. Is there anyway i can insert these records into table??
You can achieve it by using 'Bulk Insert' either in MySql or SqlServer !!!
For More Information...refer the following link..
https://dev.mysql.com/doc/refman/5.5/en/optimizing-innodb-bulk-data-loading.html
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Using MySQL, I want to retrieve all rows from a table A where a field contains "EQ" for example, copy them into table B (which has exactly the same field), and then delete them from table A.
I heard about triggers. Is that the right approach?
You need 2 SQL statements. First for inserting the data rows from A to B, and then for deleting those rows from A.
INSERT INTO B
SELECT *
FROM A
WHERE Field LIKE '%EQ%';
DELETE
FROM A
WHERE Field LIKE '%EQ%';
Triggers are a way to automate some activities when some other activity in a separate table happens. If you need to make sure that the above 2 operations should be triggered as soon someone INSERTS/DELETES/UPDATES on some other table, then you can create a trigger for that purpose. But with the simple requirement you gave above without any such dependency, I do not see a need of a trigger here.
If you do have such dependency and need, you have to provide proper requirements with details here.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I have data from an sql query which i need to update in a table. Im saving the output of this query as a csv file. When i do load this file in sql though using the import export wizard, the data is all jumbled up as the columns have shifted in a lot of cases. So unrelated data is updated in many columns.
What could be the reason for this and please suggest a resolution.
Regards,
Priyesh
The obvious answer here is to use the insert into select syntax. If you have a query already that has generated data, insert it to where you want directly without saving to a CSV.
INSERT INTO target_table
SELECT * FROM your_original_query
If the issue is manually writing out most of the column names for a 150 column table, here is a trick. From within SSMS, click on the Columns folder of the table in question, and drag that to a new query window. You will get a list of all the column names for the table. (You could then remove the few that you do not need.)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am looking for really good examples on how to work with date or datetime or how to update them correctly on a databases so that they can be "up to date". I have had this issues before with sql, when using date or datetime they would not update after I use them. The only time I could modify them would be when inserting into the table.
Also, the same applied when I used a JDBC connector to create an interface for the database. The data would modify only at inserting and not when altering.
What to use when altering a table? Update?
Example: I have an online store in which I have "Products for sale" with fields in which day I created the Product and what day I restocked(when creating restocked will have the same value as created.). I create a new product, after 3 days I restock. How can I correctly alter the product so that the day I restocked is today, not 3 days away when I first created the product?
I am using MySQL WORKBENCH 6.0 CE.
Any suggestions will be appreciated.
Thank you!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
if I had a mysql table that has, lets say 300 million rows, how would I search for a row using
SELECT id WHERE coloumn = "abc" ;
most efficiently? Can I prepare the data so it would help the sql searching through the data? Or does it parse the rows row by row?
The SQL 101 answer here is an index using CREATE INDEX:
CREATE INDEX column_index ON table_name (`column_name`)
This of course depends on your schema. You can index more than one column as well and can apply UNIQUE constraints to ensure that each value is used only once.
On large tables the CREATE INDEX operation will be brutally slow to create the first time, so schedule some downtime if necessary. Once created it will be kept up-to-date automatically.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I had a table named table1 and have a three column.. column1, column2,column3..
I want to view the value of my columns in table using VIEW statement not SELECT is it possible?
Thank in advance#
No. View is a SQL database concept. You will have to use SELECT... to create a query, which is essentially the same thing. MSAccess has no concept of Views, it uses Queries.
A view is an SQL query that has been given a name and stored in the database. That is exactly what the Access queries are.