Difference between revisions of "SQL"

From RHS Wiki
Jump to navigation Jump to search
(Created page with "== LIKE patterns == {| class="wikitable" |- ! Wildcard !! Meaning |- | % || Any string of zero or more characters. |- | _ || Any single character. |- | [ ] || Any single chara...")
 
m
Tag: visualeditor
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== LIKE patterns ==
+
== Join Example ==
 +
<syntaxhighlight lang="sql">
 +
select common_net.id, common_net.net, common_net.mask, common_net.cidr, common_country.description, common_country.code
 +
FROM common_net
 +
INNER JOIN common_country ON common_country.id=common_net.country_id;
 +
</syntaxhighlight>
 +
 
 +
==LIKE patterns==
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! Wildcard !! Meaning
+
!Wildcard!!Meaning
 
|-
 
|-
| % || Any string of zero or more characters.
+
|%||Any string of zero or more characters.
 
|-
 
|-
| _ || Any single character.
+
|_||Any single character.
 
|-
 
|-
| [ ] || Any single character within the specified range (for example, [a-f]) or set (for example, [abcdef]).
+
|[ ]||Any single character within the specified range (for example, [a-f]) or set (for example, [abcdef]).
 
|-
 
|-
| [^] || Any single character not within the specified range (for example, [^a - f]) or set (for example, [^abcdef]).
+
|[^]||Any single character not within the specified range (for example, [^a - f]) or set (for example, [^abcdef]).
 
|}
 
|}

Latest revision as of 08:45, 12 April 2019

Join Example[edit]

select common_net.id, common_net.net, common_net.mask, common_net.cidr, common_country.description, common_country.code
FROM common_net
INNER JOIN common_country ON common_country.id=common_net.country_id;

LIKE patterns[edit]

Wildcard Meaning
% Any string of zero or more characters.
_ Any single character.
[ ] Any single character within the specified range (for example, [a-f]) or set (for example, [abcdef]).
[^] Any single character not within the specified range (for example, [^a - f]) or set (for example, [^abcdef]).