如何比较两个表中的类似列名称 [英] how to compare similar column names in two tables

查看:50
本文介绍了如何比较两个表中的类似列名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两张桌子。



Faculty_Code文本(表名称Faculty_Details)



记录在Faculty_Details如下;



Faculty_Code



GS

MK
CK

NR





另一张表(表名Schedule_Details)



Faculty_Code



GS

Mk

SJ

PN



然后在组合框中的运行模式下,Faculty_Details(表格)中的所有Faculty_Code将显示在组合框中。



在组合框中Faculty_Code,如下表所示:Faculty_Details。



GS

MK

CK

NR



然后我有一个名为View的按钮。



当用户从组合框中选择Faculty_Code GS(两个表中都有Gs Faculty_Code)并单击视图按钮时。


$ b $每周两次ant显示选择教师的消息。请选择不同的教师。



如何编写查询以比较MS Access数据库中的两个表和类似列。

I have two tables.

Faculty_Code Text (Table Name Faculty_Details)

Records in the Faculty_Details as follows;

Faculty_Code

GS
MK
CK
NR


Another Table (Table Name Schedule_Details)

Faculty_Code

GS
Mk
SJ
PN

then in the run mode in the combo box all the Faculty_Code from Faculty_Details( table) will display in the combo box.

in combo box Faculty_Code as follows from the table Faculty_Details.

GS
MK
CK
NR

Then i have one button called View.

when user select Faculty_Code GS (the Gs Faculty_Code is there in the both the table) from the combo box and click the view button.

i want to show the message the select faculty is there.please select different faculty.

how to write the query to compare two tables and similar columns in MS Access Database.

推荐答案

试试这个。

try this.
select count(*) as count from Schedule_Details where Faculty_Code = 'your faculty_Code(combobox value)



然后检查计数值。如果count更大 - 则为0表示FacultyCode存在并显示您的消息。


then check count value. if count greater-then 0 it means FacultyCode exists and show your message.


这篇关于如何比较两个表中的类似列名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆