Wednesday, April 18, 2012

SQL Select


Hello Everyone, In This post I will discuss about the SQL SELECT statement, the very basic of SQL.

Well you can guess by the name SELECT that it has something to do with selecting. If you thought so, you were right, it is to select columns from a Table. So below we have the C_Korner Table.



General Syntax of the SELECT statement is:
SELECT column_name(s) FROM table_name, or
SELECT * FROM table_name

" * " means we are querying for all the columns of the table.

So for our table, if we issue
SELECT * FROM C_Korner, in our result-set we will have the entire table.

Whereas if we want to be specific, and want to look into the column of U_Name and U_Password, our Query will be:
SELECT U_Name, U_Password FROM C_Korner

So, with this only the U_Name and U_Password column will be in our result-set.

So I guess this post makes everything clear about the SELECT Statement, and how to extract a column or the entire columns from a Table.

Hope this was informative, Don't forget to check my next Post.

Thank You!

0 comments:

Post a Comment