H I O X INDIA
MySQL Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 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
Feedback





SELECT using 'where'


Topic

How to select particular row?
How to use 'where' clause in select statement?
Where to apply select where?



Explanation

    We can select a particular row using the WHERE clause statement. We can also check any condition using WHERE clause or keyword. Where condition comes handy when we come across a big table having huge volume of data but we might want to see only small number of rows satisfying a condition.

The select where syntax is

SELECT what_to_select FROM tbl_name WHERE conditions_to_satisfy;

    Here the conditions_to_satisfy specifies one or more conditions that rows must satisfy to qualify for retrieval.

    Let's see an example query for retrieving a single student data using the WHERE clause.
mysql> select * from student where name = 'jack';
+--------+------+-------+-----------------+---------+
| studid | name | marks | address         | phone   |
+--------+------+-------+-----------------+---------+
|      4 | jack |    82 | victoria street | 2436821 |
+--------+------+-------+-----------------+---------+
1 row in set (0.00 sec)
    Here in the above example query we have retrieved a single student details. Suppose if we want to retrieve the student's details who have secured more than 90 marks, we can use the below query.

mysql> select * from student where marks > 90;
+--------+-------+-------+------------------+---------+
| studid | name  | marks | address          | phone   |
+--------+-------+-------+------------------+---------+
|      1 | steve |   100 | 5th cross street | 2456987 |
|      2 | david |    98 | welling street   |  547896 |
|      5 | anne  |   100 | downing street   | 2634821 |
|      8 | mille |    98 | victoria street  | 1236547 |
+--------+-------+-------+------------------+---------+
4 rows in set (0.05 sec)


others


        MySQL is the most popular open source database Management system. 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-2005 HIOX INDIA - hioxindia.com

Other Links