Query where issue (show too many drop down list)

My company just upgraded Grafana from 7.5 to 10.3.

I found query issue with where statement that show too many value.
I want to know how to setting query to same as version 7.5

For example,

Table 1 has device A B C
Table 2 has device D E F
Same Data sources

On version 7.5
when we choose FROM Table 1 WHERE Device = … it will show drop down A B C
Or FROM Table 2 WHERE Device = … drop down D E F

However, On version 10.3
What ever we choose FROM Table 1 or 2 WHERE Device::tag … will show ALL A B C D E F that too many list, as Table 1 did not contain device D, if we choose it, it will show no data only that make we confuse.

So I want to know where and how to setting Query to get Device list from only table I choose not from all table

I am Thank you everybody in advance for help me

Welcome @twarunchai

What is your data source?
I presume when you say “drop down menu”, you are referring to template variables which were created?
Can you share some sample data?
Can you share the full queries used in your template variable queries?