1

I have two tables in access and both conttains numbers (1057, 1045, 4252, etc.) I would like to pull the similar records that is in both tables. For instance if table x has record 1057 and table y also includes 1057 than I want to see those records. Any help would be greatly appreciated. Thanks

4

1 回答 1

0
select t1.*,t2.* from table1 as t1
inner join table2 as t2 on (t1.COMMONCOLUMNID = t2.COMMONCOLUMNID)

已编辑

select * from TableName where DiscreteUID in (select predecessor from TableName) 
or
DiscreteUID in (select successor from TableName)

已编辑

    (select DiscreteUID, 1 as IsPredecessor, 0 as IsSuccessor from TableName where DiscreteUID in (select predecessor from TableName))

UNION
    (select DiscreteUID, 0 as IsPredecessor, 1 as IsSuccessor from TableName where DiscreteUID in (select successor from TableName))
于 2013-03-29T19:14:13.043 回答