Edit Article

Edited by Sharimo1, Samnav, Maluniu, Harri and 6 others

The basic SQL query for retrieving data from a MySQL database is the SELECT command.

Ad

EditSteps

  1. Retrieve Data from Mysql Step 1.jpg
    1
    Type:
    • SELECT
      • <columnname1>, <columnname2>, ... <columnnamen>'
      • FROM <tablename> ;
    Ad
    Ad


Add your own method
Save

EditTips

  • Use "*" instead of column names to get all columns.
  • You can use a function (e.g. AVG, COUNT, MAX, MIN, etc.) instead of column names.
  • Additional parameters you can append:
    • ORDER BY <columnname> - Sort resulting data by the values in the given column in ascending order.
    • ORDER BY DESC <columnname> - Sort data by values in the given column in descending order.
    • GROUP BY <columnname> - group the information by the values in the given column.
  • Lots more options exist. See the documentation at mysql.com
  • Import/Export data by using Navicat for MySQL: http://www.navicat.com
Ad

Article Info

Categories: MySQL

Recent edits by: Cwrunner93, Frankel, Chris

Ad

Thanks to all authors for creating a page that has been read 5,480 times.

Was this article accurate?

YesNo

Become
an Author!

Write an Article