私はこのような2つのテーブルを持っています:
Table 1
-------
ID
score
Table 2
-------
ID
score_from
score_to
表 2 の score_from と score_to に基づいて Table1 に score='12' がある場合、表 2 から ID を取得するにはどうすればよいですか?
Contents of Table1:
----------------------
ID |Score |
----------------------
1 |12 |
----------------------
2 |40 |
----------------------
Contents of Table2:
------------------------------
ID |score_from|score_to|
------------------------------
1 |0 |20 |
------------------------------
2 |21 |40 |
------------------------------
table1 の score='12' がある場合、table2 の ID='1' を取得するクエリを作成するにはどうすればよいですか?