Home SQL Basic SQL Where Keyword
07.09.2010
Main Menu
Programming
.NET Controls
Operating System
Databases
Articles
Add to: Digg Add to: Del.icoi.us Add to: Reddit Add to: StumbleUpon Add to: Slashdot Add to: Yahoo Add to: Technorati Add to: Google
SQL Where Keyword

Now let say we want to filter out certain information, we can use the WHERE keyword to filter out the specific records. The result will then return all the records where the conditional criteria have met. For example if we want to retrieve all the student records who paid their course fees over a $1000, then we can use the WHERE keyword.

SYNTAX:

SELECT "column_name"
FROM "table_name"
WHERE "condition"

Table: Student 

StudentID LastName FirstName DOB CourseFees
1 John Astone 07/15/1976 1000.00
2 Bob Eastwood 02/13/1935 1500.00
3 Jane Hollywood 03/23/1939 2000.00
4 Bob Eastwood 03/19/1980 3000.00

 This examples will show you how to retrieve all the records where all student paid their course fees over $1000.00.

SELECT * FROM Student WHERE CourseFees > 1000.00

RESULT:

StudentID LastName FirstName DOB CourseFees
2 Bob Eastwood 02/13/1935 1500.00
3 Jane Hollywood 03/23/1939 2000.00
4 Bob Eastwood 03/19/1980 3000.00



Comments (0)
Write comment
Your Contact Details:
Comment:
[b] [i] [u] [url] [quote] [code] [img]   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."