H I O X INDIA
MySQL Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

Mysql Tutorial
Introduction
How to Install
Database
Datatypes
Tables
INSERT
SELECT
UPDATE
DELETE
Operators
Functions
Ask Your Doubts
More about Mysql
Feedback




Select columns from a Mysql Database Table


Topic

How to select a particular column from a Mysql database?
How to select multiple columns from a Mysql database?



Explanation

    We can select a particular column to display, regretting the entire rows. Suppose you want to see the name of the students alone we can use the below query.

mysql> select name from student;
+---------+
| name    |
+---------+
| steve   |
| david   |
| michael |
| jack    |
| anne    |
| steve   |
| anne    |
| mille   |
+---------+
8 rows in set (0.27 sec)
    We can also select multiple columns, separated by commas as given in the below query.
mysql> select name, marks from student;
+---------+-------+
| name    | marks |
+---------+-------+
| steve   |   100 |
| david   |    98 |
| michael |    75 |
| jack    |    82 |
| anne    |   100 |
| steve   |    75 |
| anne    |    80 |
| mille   |    98 |
+---------+-------+
8 rows in set (0.03 sec)
    In the above query, we have selected both name and marks from the table student.






        MySQL is the most popular open source Relational database Management system (RDBMS). Being a open source anyone can use and change the software for their needs. Hope you enjoy this tutorial. We welcome your Valuable feedbacks or suggestions on this MySQL tutorial. This is a copyright content.


privacy policy     license     sitemap
© 2004-2009 HIOX INDIA - hioxindia.com

Other Links