-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathin.html
More file actions
39 lines (30 loc) · 1.59 KB
/
in.html
File metadata and controls
39 lines (30 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!-- SECCIÓN IN -->
<div id="in-section">
<div id="adsense-container" style="width: 350px; position: absolute; left: 0px;"></div>
<div class="inner-modal">
<div class="inner" style="padding: 0px;">
<h1>SQL IN Operator</h1>
<p>The IN operator allows you to specify multiple values in a WHERE clause.</p>
<p>The IN operator is a shorthand for multiple OR conditions.</p>
<h2>IN Syntax</h2>
<pre><code class="language-sql">SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1, value2, ...);</code></pre>
<p>or:</p>
<pre><code class="language-sql">SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);</code></pre>
<h2>IN Operator Examples</h2>
<p>The following SQL statement selects all patients that are located in "SK", "AB" or "MB":</p>
<pre><code class="language-sql">SELECT * FROM patients
WHERE province_id IN ('SK', 'AB', 'MB');</code></pre>
<p>The following SQL statement selects all patients that are NOT located in "SK", "AB" or "MB":</p>
<pre><code class="language-sql">SELECT * FROM patients
WHERE province_id NOT IN ('SK', 'AB', 'MB');</code></pre>
<p>The following SQL statement selects all patients that have the same first_name as a doctor:</p>
<pre><code class="language-sql">SELECT * FROM patients
WHERE first_name IN (SELECT first_name FROM doctors);
-- Try running just the sub query to see the list</code></pre>
</div>
</div>
</div>