Posts in category “Tips”

Fix Albert core dumping after the first request After the system upgrades

Steps:

rm ~/.config/albert/core.db 

Reference

JetBrains Rider/Intellij... Disabling database schema/table names being prepended with autocomplete

Preferences/Settings

Editor > General > Code Completion > SQL > Qualify object with > Table > Never.

Reference

Keep the the same order as input data when using `WHERE fieldName IN(fieldVal1, fieldVal2)`

Don't waste time; here's the sample code with the Oracle database.

SELECT * FROM SampleTable WHERE sample_field in (7,3,4,6) ORDER BY INSTR(',7,3,4,6,',  ',' || sample_field || ',');

Two useful links from google photos you might not know

Unsaved creations

https://photos.google.com/unsaved

Possibly all creations?

https://photos.google.com/foryou

MySQL IF(EXPRESSION, A, B) equivalent in PL/SQL (Oracle)

In MySQL, we can

SELECT IF(A IS NULL, "something", A) FROM some_table;

If you want to do a similar thing in PL/SQL, you need to

SELECT (CASE WHEN A IS NULL THEN "something" ELSE A END) FROM some_table;

If you want to get the first non-null value from several fields, you have a better choice than using the CASE keyword.

SELECT COALESCE(A, B) FROM some_table

see more information about the Oracle COALESCE function