I feel like this is something I can search for, but I don’t know the correct terminology to go about it.
I have a SQL database that has a a few tables. One table stores caller logs for a softphone (agent_log), one table stores campaign information for what the people on the softphone are calling on (campaigns). Both tables have the column “campaign_id” that I can use to call to each other (I think). I need to relate these two tables so that I can have a sql query that would look like
SELECT * FROM agent_log WHERE active = 'Y';
Obviously it doesn’t work because the column ‘active’ doesn’t exist in that table, it exists in the campaigns table. Is there any simple way to go about this?
id campaign_id exists in both table and assuming that there is a relation between table you can join them:
if you like to use JOIN i suggest you spend some of your time to learn it.