日期:2014-05-19  浏览次数:20415 次

关于数据库约束的一个较难问题!
哪位高人能帮我实现以下功能:
现有两张表:
table1(id   idType   value)
table2(id   name)
给表table2.id字段加一个约束,
要求table2.id的值必须从(select   id   from   table1   where   idType= '1120 ')中取,
该如何实现啊!!
谢谢各位给点提示!!

------解决方案--------------------
select ..
union
select ..