0


How to query csv file using mysql? i have a .csv file and i want to query it so that i could get distinct record value from csv file.

Thanks
Yugal

2 Answers 2

2

You can't. You need to import it into mySQL. mySQL's command for that is LOAD DATA INFILE.

Sign up to request clarification or add additional context in comments.

2 Comments

Pekka: is there any other way to import only distinct record from csv file by mysql query?
@yugal I don't think so, no. I think the best way is still to import the whole file into a temporary table, then remove all the unwanted records
1

You need to load it into MySQL table first. Then query as usual.

Alternatively you can try experimenting with CSV storage engine.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.