Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Select Some Rows from a Table
How To Select Some Rows from a Table? - MySQL FAQs - SQL SELECT Query Statements with GROUP BY
✍: FYIcenter.com
If you don't want select all rows from a table, you can specify a WHERE clause to tell the query to return only the rows that meets the condition defined in the WHERE clause. The WHERE clause condition is a normal Boolean expression. If any data from table needs to be used in the Boolean expression, column names should be used to represent the table data.
The first select statement below only returns rows that have url names containing the letter "a". The second select statement returns no rows, because the WHERE clause results FALSE for all rows in the table.
mysql> SELECT * FROM fyi_links WHERE url LIKE '%a%'; +-----+-------------------+-------+--------+--------------- | id | url | notes | counts | created +-----+-------------------+-------+--------+--------------- | 102 | dba.fyicenter.com | NULL | 0 | 2006-07-01 12: | 103 | sqa.fyicenter.com | NULL | NULL | 2006-07-01 12: +-----+-------------------+-------+--------+--------------- 2 rows in set (0.00 sec) mysql> SELECT * FROM fyi_links WHERE FALSE; Empty set (0.00 sec)
2007-05-11, 6598👍, 0💬
Popular Posts:
What is the main difference between a Vector and an ArrayList? Java Vector class is internally synch...
What are urlencode() and urldecode() functions in PHP? string urlencode(str) - Returns the URL encod...
What exactly happens when ASPX page is requested from Browser? Note: - Here the interviewer is expec...
What print out will the folloging code produce? main() { char *p1=“name”; char *p2; p2=(char*)malloc...
What Is the Difference between Formal Parameters and Actual Parameters? - Oracle DBA FAQ - Creating ...