私は2つのテーブルを持っています
テーブルA
imei_no | user_name | date_of_allocation | date_of_deallocation
123 | a | 1-4-2013 | 10-4-2013
456 | a | 10-4-2013 | 25-4-2013
789 | a | 25-4-2013 | 30-4-2013
123 | b | 25-4-2013 | 27-4-2013
テーブルB
imei | lat | long | gpsdate
123 | 23 | 43 | 2-4-2013
123 | 23 | 43 | 2-4-2013
456 | 23 | 43 | 3-4-2013
123 | 23 | 43 | 3-4-2013
789 | 23 | 43 | 24-4-2013
123 | 23 | 43 | 24-4-2013
456 | 23 | 43 | 28-4-2013
123 | 23 | 43 | 28-4-2013
特定のユーザーのimeiに、2013年5月4日から2013年4月25日までの日付を言ってもらいたい:
select imei from A where user_name='a' and date_of_allocation>='5-4-2013' and date_of_deallocation<='25-4-2013';
そして、テーブル B からそのユーザーのデータが必要です。どうすればそれを行うことができますか。
select Imei of user a from some date to some date,then data of that imei for that user from table B