I have two tables
table 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
table 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
I want imei of a particular user say a from date 5-4-2013 to 25-4-2013 I am doin this:
select imei from A where user_name='a' and date_of_allocation>='5-4-2013' and date_of_deallocation<='25-4-2013';
and I want the data of that user from table B. how can I do that.
select Imei of user a from some date to some date,then data of that imei for that user from table B