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 Use Subqueries with the EXISTS Operator
How To Use Subqueries with the EXISTS Operator? - MySQL FAQs - SQL SELECT Statements with JOIN and Subqueries
✍: FYIcenter.com
A subquery can be used with the EXISTS operator as "EXISTS (subquery)", which returns true if the subquery returns one or more rows. The following statement is a good example of "EXISTS (subquery)". It returns rows from fyi_links table that there are rows existing in the fyi_rates table with the same id.
mysql> SELECT id, url, tag, YEAR(created) As year FROM fyi_links WHERE EXISTS ( SELECT * FROM fyi_rates WHERE fyi_rates.id = fyi_links.id); +-----+-------------------+------+------+ | id | url | tag | year | +-----+-------------------+------+------+ | 101 | dev.fyicenter.com | DEV | 2006 | | 102 | dba.fyicenter.com | DBA | 2006 | | 103 | sqa.fyicenter.com | SQA | 2006 | +-----+-------------------+------+------+ 3 rows in set (0.00 sec)
2007-05-11, 5722👍, 0💬
Popular Posts:
How is the MVC design pattern used in Struts framework? In the MVS design pattern, there 3 component...
it will be very helpful if you send some important Questions with Answers of DBMS Tell us what types...
How can you enable automatic paging in DataGrid ? Following are the points to be done in order to en...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...
Describe different elements in Static Chart diagrams ? Package: - It logically groups element of a U...