Pages

Showing posts with label SQL Query. Show all posts
Showing posts with label SQL Query. Show all posts

Tuesday, 20 June 2023

COALESCE() Function

 Return the first non-null value in a list.

Example:

SELECT COALESCE(NULL, NULL, NULL, 'value 1', NULL, 'value 2') FROM dual;

Output: value 1

Wednesday, 7 June 2023

Find second max value in the table (nth max value)

--Second maximum column value

SELECT *

FROM customers

ORDER BY age DESC, first_name ASC

LIMIT 1,1; -- 1 - number of row to omit, 1 - no of records to show


Code Review

 SOLID Principles S – Single Responsibility Principle There should never be more than one reason for a class to change. O – Open-Closed Prin...