The School for Champions is an educational website that shows you how to achieve your dreams.
![]() |
|
|
Explanation of Retrieving Columns from a Database Table - Succeed with SQL. Also refer to Access, MySQL, MS SQL Server, SELECT, wildcard, comma, Ron Kurtus, School for Champions. Copyright © Restrictions Retrieving Columns from a Database Table in SQLby Ron Kurtus (3 February 2007) You can use SQL to retrieve the columns of a database table with the SELECT statement. You can retrieve all columns, a single column, or several specific columns. It is then up to your programming language to display that data. Questions you may have include:
This lesson will answer those questions. There is a mini-quiz near the end of the lesson. All columnsYou can query a database to retrieve all the elements in a database table by using the SELECT statement and wildcard (*) indicator.
Note: It is standard practice to add ";" at the end of your SQL query. Some databases require it and some don't. Single columnThe most common query from a database is to collect or retrieve all the elements in a specific column of the database table.
Several select columnsYou can also retrieve data from several columns by separating the column names with a comma.
Note: Do not place a comma after the last item in the list, because it will result in an error message. SummaryThe SELECT statement is used to retrieve the columns of a database table. You can retrieve all columns, a single column, or several specific columns. ResourcesThe following are resources on this subject. WebsitesBooksMiscellaneousMini-quiz to check your understanding1. What is a "wildcard" symbol mean? 2. Why is ";" used after the table name? 3. Does the order you list the columns matter? If you got all three correct, you are on your way to becoming a Champion in working with SQL. If you had problems, you had better look over the material again. What do you think?Do you have any questions, comments, or opinions on this subject? If so, send an email with your feedback. We will try to get back to you as soon as possible. Share linkFeel free to establish a link from your website to pages in this site. Or use our form to send this link to yourself or a friend. Students and researchers:The Web address of this page is Please include it as a reference in your report, document, or thesis. Where can you go from here?
|
The School for Champions helps you become the type of person that can be can be called a Champion.