【发布时间】:2014-01-01 19:51:39
【问题描述】:
Mentor table
------------
name (varchar)
contact (int)
english (boolean)
french (boolean)
german (boolean)
Student table
-------------
name (varchar)
contact (int)
english (boolean)
french (boolean)
german (boolean)
我想根据语言将导师与学生匹配,例如:
如果导师 1 懂英语和法语,他将匹配所有至少懂英语或法语的学生。
mentor1 (english, french)
-------------------------
studentA (english);
studentB (english, french);
studentC (english, german);
studentD (english, french, german)
如果mentor2 只懂德语,他将匹配所有至少懂德语的学生。匹配的学生不仅会德语。
mentor2 (german)
----------------
studentC (english, german)
studentD (english, french, german)
通常我只会使用一堆if then else 来拼凑一个sql 字符串,但我使用gridview 来显示数据所以我不确定我能做什么。
欢迎提供示例代码和教程。
编辑:忘了提到mentor 表也将有name 和contact 等列。所以gridview 上的输出应该是每mentor 1 行。
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
标签: asp.net sql sql-server vb.net select