MySQL Values Relying on Different Tables

2021-03-23T09:47:02

In this database:

Happy Insurance

I need to write an SQL query that will display the name of each client of the agent with the highest agent rating in the company.

What I'm trying right now is,

SELECT ClientName
FROM CLIENT.ClientName
WHERE CLIENT.AgentID = AGENT.AgentID AND MAX(AGENT.AgentRating);

I'm new to MySQL, so I just want to check if I'm using the MAX and AND operators properly, or if there's a simpler way to do this.

Copyright License:
Author:「H Watson」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/66756150/mysql-values-relying-on-different-tables

About “MySQL Values Relying on Different Tables” questions

In this database: I need to write an SQL query that will display the name of each client of the agent with the highest agent rating in the company. What I'm trying right now is, SELECT ClientName ...
I want to fill up a relation table in MySQL only using (My)SQL-statements. The problem, why I am stucking right now is, that I have to fill the data relying on other tables with conditions. I never...
I have two tables in mysql that contain details about users such as email, first name and last name. and I made a way to welcome the user that login but the problem is that some value in the two t...
I'm basing on this question: mySQL sum of two values in 2 different tables In my case, the tables does look like this: table_1 reference quantity name TS00001 235 AAA TS00002 ...
I am in need of some help with mysql since I'm a novice with it. I need to count the values of different tables from different databases and put them all in one table, after that make an index for ...
As suggested from MySQL -- join between tables in 2 different databases?, I used the following format to retrieve data that have shared column values across the two tables from different mysql data...
I want to merge two or more tables in to one, for example, I have table1.csv and table2.csv, they are from different Mysql server but have the same structure like [A, B, C, datatime]. For different
I have a MySQL db that has 2 tables that have related information that I need to merge to 1 table. Gallery has an itemid that relates to rbitems Id. Both tables gallery and rbitems have different ...
I have several tables with marginally different columns. For simplicity say I have two tables: mytable1: UserId (int) (primary key) Save (blob) mytable2: UserId (int) (primary key) Save (blob) ...
Suppose I have 2 InnoDB tables A and B. Table A has a column named Acountry of type INT Table B has a column named Bcountry of type VARCHAR Some records in table A have in column Acountry values ...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.