skip to Main Content

Mysql – Get second highest salary in SQL

Getting Connection Lost in coorelated queries. select emp_no,salary from salaries e where 2 = (select count(distinct salary) from salaries p where p.salary>e.salary); I tried this to get second highest salary but its giving me sql connection lost every time. All…

VIEW QUESTION

mysql subselect on group by

I have a table of locations CREATE TABLE `asset_location_rel` ( `a_id` int(11) NOT NULL, `asset_id` int(11) NOT NULL, `location_id` int(11) NOT NULL, `deleted` int(11) NOT NULL DEFAULT 0, `units` int(11) NOT NULL DEFAULT 1, `unit_type` tinyint(4) NOT NULL ) ENGINE=InnoDB…

VIEW QUESTION
Back To Top
Search