0
votes
1answer
69 views

How to find the same salaries and department names?

Write a query to display last name ,department number,and salary of any employee whose department number and salary both match the department number and salary of any employee using the following ...
0
votes
1answer
32 views

Need to find the employees who have switched jobs atleast twice

I am trying the following query on the tables which are described below: SELECT * FROM job_history INNER JOIN employees ON job_history.employee_id = employees.employee_id WHERE employee_ID IN ...
0
votes
2answers
61 views

How do I add an alias to the table

SELECT MAX(COUNT), A.id FROM ( SELECT supplier_id as id, COUNT(*) AS count FROM `library`.`lms_book_details` GROUP BY supplier_id ) GROUP BY A.id; While executing the query, MySQL gives ...
0
votes
2answers
62 views

Select * on inner join with common columns

I have 3 tables (mysql db) on which I want to do an inner join. The problem is that these tables have common columns. I know I could use aliases to differentiate them (select A.x as Ax, B.x as Bx, C.c ...
0
votes
1answer
75 views

Mysql Alias IF statement

How do you query something like if parent = 0 then alias is network_id else alias is group_id Is this possible with only queries?
0
votes
0answers
84 views

column alias not displayed as column name when export the result of mysql query to excel

I am trying to get the total number of tables present in each database and export it to excel sheet. so i had tried this mysql -h192.168.0.xxx -P -uxxxx -pxxxx information_schema -e " select ...
0
votes
2answers
1k views

Multiple Aliases in an SQL Query

Would it be possible to give a table in MySQL query multiple aliases? If so how would I do this?