De-duplicate rows in #SQL query results with
SELECT DISTINCT col1, col2, ...
This returns one row for each unique combination of values stored in the DISTINCT columns
This should be a rare operation!
Repeated use of DISTINCT is often a sign of flaws in the query or schema
Filter the rows returned by a #SQL query with
WHERE <condition>
<condition> can be any valid SQL condition, e.g.
number = 1
letter like 'A%'
You can combine conditions with AND/OR; the database returns rows where
AND - all conditions are TRUE
OR - any condition is TRUE
This is an Alberta Emergency Alert. The City of Calgary has issued a water supply alert.
This alert is in effect for all communities of Calgary’s water supply, including Airdrie, Strathmore, Tsuu T’ina Nation and Chestermere.
A feeder main break along 16 Avenue Northwest has impacted the city’s water supply. Supply levels remain in a critical state, affecting the city’s ability to provide water to communities and ensure adequate water is available for firefighting.
All residents and businesses must conserve water. Reduce indoor water consumption as much as possible.
Limit showers and flushing toilets.
Only do full loads in the dishwasher and washing machine.
Monitor local media or https://t.co/1lAYYzydTb for updates.
Looking for strategies, tools, and best practices to upgrade or migrate to Oracle Database 23ai? Don’t worry—Oracle Data Deep Dive at #AIWorld has the sessions you’re looking for. Learn more: https://t.co/P7RmGsDoI0
Are you making any of these common #SQL mistakes?
Forgetting about NULL
Processing data in Java memory
Using JDBC Pagination to paginate large results
Using aggregate instead of window functions
Lukas Eder explains what to do instead & lists 7 more
https://t.co/k8ArDcvvUQ
Oracle Database 21c enhanced FOR LOOPs in PL/SQL to enable you to use
Custom increments (BY)
Lists of values to loop through
Conditions to skip the loop body (WHEN)
Expressions to set the next value (REPEAT WHILE)
Mutable iterands to set their value inside the loop (MUTABLE)
You can subtract one year from a date in Oracle #SQL with either
ADD_MONTHS ( dt, -12 )
- INTERVAL '1' YEAR
But take care - these handle 29th Feb differently:
ADD_MONTHS => 29th Feb -> 28th Feb in previous year
INTERVAL => 29th Feb -> 29th Feb in previous year => error!
Create blockchain tables in Oracle Database with
CREATE BLOCKCHAIN TABLE ... ( ... )
NO DROP UNTIL n DAYS IDLE
NO DELETE UNTIL n DAYS AFTER INSERT
HASHING USING SHA2_512 VERSION "v1"
These
Allow INSERT
Disallow UPDATE
Disallow DELETE/DROP until you wait N days as defined