I have a table called accounts
I have fields called
id
provider
type
account_name
they are structured as
id - int(12)
provider -int(12)
type - int(12)
account_name - Varchar(25)
I think a join or subquery could work but cant get it work
The aim is i want to display providers that have both type=2 and type=5 ORDER By account_name
eg shows companies that sell both real estate and loans
Select * from accounts WHERE type = 2 and type=5
I know the above doesnt work but its kind the mindset that i need. Id appreciate any help in getting this working.
The mysql output result should look like this in a single line.
Eg
Provider Account_Name1(this matched 2) Account_Name2(Matched 5) Johnson - Johnson Real Estate - Johnson Loans