Hi All,
I have a table with following structure;
Table 1
---------------------------------------------------------------
ID | Zone | Area | Indicator | Value | Timestamp | Collector_ID
----------------------------------------------------------------
Collector_ID is a foreign key from another table of the following structure;
Table 2
----------------------------------------------------------------------------
ID | Collector_Name | Filename | Collection_Time | Added_at
----------------------------------------------------------------------------
I am trying to write a join query that will give me all the records from table 1 joining it with table two where collector_name contains "Agent_A" or "Agent_B.
Here is what i have been trying with:
select * from table_1 as one
inner join
table_2 as two
on one.collector_id = two.id
where
two.collector_name like %Agent_A% or
two.collector_name like %Agent_B% ;
Please help me to find errors or guide me if I am completely wrong.
Thank you very much!