if we want to load data from a text file into a mysql table,
but the columns in table are 1st: code(int) and 2nd:
city(varchar), but in text file the format is 1st cityname
and then code separeted by delimeters. how to load?
Answers were Sorted based on User's Feedback
Answer / vijay singh
LOAD DATA INFILE 'data.txt' INTO TABLE table2
FIELDS TERMINATED BY ',';
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / vipul dalwala
LOAD DATA INFILE 'data.txt' INTO TABLE table_name
(city,code);
| Is This Answer Correct ? | 0 Yes | 0 No |
What is row level locking?
Explain the different types of constraints?
How to get a list of all tables in a database?
What is Foreign Key? What is the main difference between primary key and Foreign Key ? How Foreign Key can be defined? Is Foreign key is used to join two or more table?
how we will Show selected records sorted in an ascending (asc) or descending (desc).
How to determine the location of the data directory?
what if you really want to store the timestamp data, such as the publication date of the article?
How can you do the fine tunning?
How to calculate the difference between two time values?
What is procedures in mysql?
How can we change the name of a column of a table?
What is difference between unix timestamp and mysql timestamp?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)