Using Where Conditions : Where : Where Clause SQL / MySQL


SQL / MySQL » Where Clause » Where »

 

Using Where Conditions



/*
mysql> SELECT Name FROM Student WHERE StudentID = 3;
+-------------+
| Name        |
+-------------+
| JJ Harvests |
+-------------+
1 row in set (0.00 sec)


*/

/* Prepare the data */ 
DROP TABLE Student;

CREATE TABLE Student (
   StudentID INT NOT NULL PRIMARY KEY,
   Name      VARCHAR(50NOT NULL
)TYPE = InnoDB;


/* Insert data for testing */ 
INSERT INTO Student (StudentID,NameVALUES (1,'Joe Yin');
INSERT INTO Student (StudentID,NameVALUES (2,'Cory But');
INSERT INTO Student (StudentID,NameVALUES (3,'JJ Harvests');
  
/* Real command */
SELECT Name FROM Student WHERE StudentID = 3;

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

SQL / MySQL

 Navioo Where Clause
» Where