Hi all, I am having some trouble retrieving data from my DB. I was wondering if anyone could help?
The structure exists like this:
An marketing company table (primary key is marketing company name)
each marketing company has many agents. The agents are stored in the agent table. The marketing company they belong to is identified by the marketing company secondary key.
Each agent generates many sales leads. The sales leads "owners" are identified by the agent secondary key.
If I want to find out all the leads generated by an agent, this is simple, SELECT * FROM Leads WHERE agentname="agentname"
How about if I want to find every lead generated by a marketing company? How can I achieve this in a query?
I hope I explained the structure sufficiently.