I have a table with 6 different fields. two of them are numbers from celular phones. One the phones owned by a company and the other field is related to destination calls, i have about 60000 records.
I need to make a query that filters the destination calls, in order to know who is calling from our celular phones (Field 1 ) to our celular phones (Field 2 -destination), I just need to know who´s calling internly, from our cellular phones to our cellular phones.
I think I understand what you mean. You want all records where field2 is one of your phones. And field 1 happens to contain the list of all your phone numbers.
SELECT Calls.OurNumber, Calls.CalledNumber
FROM Calls RIGHT JOIN Calls AS Calls_1 ON Calls.CalledNumber = Calls_1.OurNumber
WHERE Calls.OurNumber Is Not Null;
The point is you can re-reference the table you are using by making an alias. In this case we created the alias with "Calls AS Call_1" so we can reference fields from Calls_1 as if it were a different table.
I used OurNumber and CalledNUmber instead of Field 1 & 2 for clarity. Also the table I used is called Calls.
Create a new blank query without adding any tables. Click on the SQL button (or View=>SQL). Paste the entire expression in there. You will need to change the expression to use your own table names and field names.