亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

MySQL, check if foreign key is assigned to any table
P粉993712159
P粉993712159 2023-08-17 12:51:10
0
1
645
<p>I have a table called <code>files</code> Additionally, I have over 100 tables in which I use associations/foreign keys <code>file_id</code></p> <p>How do I get all <code>files</code> that do not have an existing association (that is, the file is not attached to any table)? </p>
P粉993712159
P粉993712159

reply all(1)
P粉566048790

I usually do this in bash (it might be possible to use SQL, but I'm not sure which table)

table_names=`echo "show tables"|mysql database_name -q -s|grep -v "show tables"`
for table in $table_names
do
  echo $table
  mysqldump database_name $table |grep file_id
done;

Then you will see something related to file_id in each table.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template