联接数据表
<h1>功能</h1>
<p>1.通过选择具体的联接类型,将两数据表进行联接。
2.可根据join属性中设置的约束性条件进行连接。</p>
<h1>输入</h1>
<table>
<thead>
<tr>
<th>名称</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>数据表1</td>
<td>[DataTable]自定义,进行联接的数据表。</td>
<td>源数据表</td>
</tr>
<tr>
<td>数据表2</td>
<td>[DataTable]自定义,进行联接的数据表。</td>
<td>目标数据表</td>
</tr>
</tbody>
</table>
<h1>选项</h1>
<table>
<thead>
<tr>
<th>名称</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>Join</td>
<td>[string]自定义,设置联接的约束条件。</td>
<td>数据</td>
</tr>
<tr>
<td>联接类型</td>
<td>[integer]自定义,根据具体联接选择类型。</td>
<td>全部</td>
</tr>
</tbody>
</table>
<h1>输出</h1>
<table>
<thead>
<tr>
<th>名称</th>
<th>说明</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>数据表1</td>
<td>[DataTable]自定义,生成的联接数据表变量。</td>
<td>数据表连接</td>
</tr>
</tbody>
</table>
<h1>注意/说明</h1>
<p>1.进行联接的两个数据表,必须要有共同的列。
2.两表联接的规律:
数据表1:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/6cc199d095eefbf2063524f26c6d3828" alt="" />
数据表2:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/d428334e388566e4438749b9d169e5bb" alt="" />
(1)左连接:则显示的是左边以及共同部分的数据(即如图中的数据表1的所有数据以及数据表1和数据表2中相同的数据。)
(2)内连接:则显示的是两个数据表中的共同部分。
(3)全部:则显示的是两个数据表的所有数据。
3.在联接形成的新的数据表中,如果String类型的某列或某行中的数据在其源数据表中无对应的数值,则显示为空;如果Int类型的某列或某行中的数据在其源数据表中无对应的数值,则显示为0,如下图所示:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/93dee1dafab73d5ce76cdeb774ab25fb" alt="" />
4.选项栏中的“join”属性值的含义:
(1)如下图所示的操作(表1和表2中的列2的值相等)的含义:列2中相等的数值所对应的行的数据进行联接;列2中不相等的数值所对应的行的数据将按照联接类型进行处理。如果联接类型是“左连接”:则列2中不相等的数值所对应的行的数据,保留数据表1中的数据,数据表2中的数据将为空(如果是string类型的显示为空,如果是int类型的显示为0)
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/30f00d78f92b7a9143ebeb0036cdd4b1" alt="" />
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/a88bd1b1c8a16fdb4986f6e2a059c0ff" alt="" /></p>
<h1>相关函数</h1>
<p>无</p>
<h1>示例/演示</h1>
<p>联接操作设置如下:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/630450b08c5d044e93e3a57cd16b733b" alt="" />
进行内连接的结果:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/7bd9960697cbd5cf1f79df10d6ff9bed" alt="" />
进行左连接的结果:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/35aae93df574eaa481171ef89c4a6dbb" alt="" />
进行全部联接的结果:
<img src="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/068a676c87dafa8fb29e368075d151be" alt="" /></p>
<h1>示例附件</h1>
<p><a href="https://www.showdoc.com.cn/server/api/attachment/visitfile/sign/969412dd99c31b050b219db246e34055" title="[组件[联接数据表]_20210419.db">组件[联接数据表]_20210419.db</a></p>