PHP MySql Web Hosting

PHP and MySQL Web Development

,ch03.13605 Page 139 Wednesday, November 29, 2000 4:42

Filed under: PHP MySQL Web Hosting — webmaster @ 9:35 pm

,ch03.13605 Page 141 Wednesday, November 29, 2000 4:42 PM Table 3-9: Search Conditions Using the WHERE Clause (continued) Search ConditionShorthand Syntax Example Usage & DescriptionJOIN check WHERE [NOT] column_value(s) [(+)]=[(+)] column_value(s) OrWHERE [NOT] column_value(s) [*]=[*] column_value(s) SELECT a.au_lname, a.au_fname, t2.title FROM authors a, titleauthor t1, titles t2WHERE a.au_id = t1.au_idAND t1.title_id = t2.title_idORDER BY t2.title JOIN checks can be performed byevaluating the common key betweentwo or more tables. Outer joins areaccomplished in PostgreSQL byadding the asterisk to the side whereall records should be retrieved. Outerjoins in Oracle are accomplished byadding the plus sign in parentheses(+) to the side where null values areallowed (basically, the opposite of theasterisk method). Refer to theprevious section on JOINs for more information. LIKE check WHERE [NOT] column_name [NOT] LIKE ‘match_string’ /* get any phone number starting with415 */ SELECT * FROM authorsWHERE phone LIKE ‘415%’ LIKE tells the query to use patternmatching on the string in quotationmarks. The wildcard symbols aredetailed under the LIKE entry. EXISTence check WHERE [NOT] EXISTS (subquery) SELECT p1.pub_nameFROM publishers p1WHERE EXISTS(SELECT * FROM titles t1WHERE pub_id =p1.pub_idAND type = ‘psychology’) EXISTS is always used in conjunctionwith a subquery; rather than returningdata, the subquery is a Boolean test ofwhether the data exists. This examplewill return all publishers ofpsychology books. BETWEEN range check WHERE [NOT] expression [NOT] BETWEEN expression ANDexpression SELECT * FROM titlesWHERE ytd_sales BETWEEN 4000 AND 9000 BETWEEN performs an inclusiverange check. It is the same as WHERE (expression >= x and expression <= y).

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP MySQL Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by PHP MySQL Web Hosting