0

How do I know one table's primary key field value (eg ID) is used in any another related tables in MySQL?

Please help me.

4

1 回答 1

1

You have to know the structure of your database. Then you can do something like

select * from your_table where id in 
(
    select id from ref_table1
    union
    select id from ref_table2
    union
    select id from ref_table3
)
于 2012-07-13T12:55:41.223 回答