Difference between revisions of "LIKE Predicate"

From Recital Documentation Wiki
Jump to: navigation, search
 
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=LIKE PREDICATE=
 
 
 
==Class==
 
SQL Applications
 
 
 
 
==Purpose==
 
==Purpose==
 
Special predicate
 
Special predicate
Line 15: Line 8:
  
 
==See Also==
 
==See Also==
[[PREDICATES]], [[SQL INSERT|INSERT]], [[SQL SELECT|SELECT]], [[SQL UPDATE|UPDATE]]
+
[[SQL INSERT|INSERT]], [[SQL Predicates|PREDICATES]], [[SQL SELECT|SELECT]], [[SQL UPDATE|UPDATE]]
  
  
Line 31: Line 24:
 
|-
 
|-
 
|}
 
|}
 +
  
 
The optional NOT evaluates whether the specified <expression1> does not match <expression2>.
 
The optional NOT evaluates whether the specified <expression1> does not match <expression2>.
Line 37: Line 31:
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
 
+
SELECT name, address, balance, cost*1.15;
EXEC SQL
+
  FROM accounts;
SELECT name, address, balance, cost*1.15
+
  WHERE paid_date < date() AND name LIKE "%inc%";
FROM accounts
+
  ORDER BY name, paid_date
WHERE paid_date < date() AND name LIKE "%inc%"
+
ORDER BY name, paid_date;
+
 
</code>
 
</code>
  
  
 
==Products==
 
==Products==
Recital Database Server, Recital Mirage Server, Recital Terminal Developer
+
Recital, Recital Server
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
[[Category:Reference]]
 

Latest revision as of 17:20, 22 December 2009

Purpose

Special predicate


Syntax

<expression1> [NOT] LIKE <expression2>


See Also

INSERT, PREDICATES, SELECT, UPDATE


Description

LIKE is a special predicate to evaluate whether the specified <expression1> matches <expression2>. The <expression2> can contain the following wildcards:


Operator Description
_ Any single character
% Zero or more characters


The optional NOT evaluates whether the specified <expression1> does not match <expression2>.


Example

SELECT name, address, balance, cost*1.15;
  FROM accounts;
  WHERE paid_date < date() AND name LIKE "%inc%";
  ORDER BY name, paid_date


Products

Recital, Recital Server