Search By Label
heroku apps
heroku apps:info --app example
REPLACE(original_string, search_string, replacement_string)
or
SELECT REPLACE('Hello, World!', 'World', 'Universe'); -- Returns 'Hello, Universe!'
SELECT CEIL(5.2); -- Returns 6
SELECT CEIL(-3.8); -- Returns -3
SELECT CEIL(10); -- Returns 10 (no change as it's already an integer)
SELECT FLOOR(5.7); -- Returns 5 SELECT FLOOR(-3.2); -- Returns -4 SELECT FLOOR(10); -- Returns 10 (no change as it's already an integer)
SELECT employee_name, salary, CASE WHEN salary < 30000 THEN 'Low Income' WHEN salary >= 30000 AND salary < 60000 THEN 'Medium Income' WHEN salary >= 60000 THEN 'High Income' ELSE 'Unknown' END AS income_category FROM employees;
async function* fetchUsers() { let page = 1; const perPage = 10; // Number of users per page
while (true) { const response = await fetch(`https://api.example.com/users?page=${page}&per_page=${perPage}`); const users = await response.json();
if (users.length === 0) { // No more users to fetch break; }
for (const user of users) { yield user; }
page++; } }
// Usage:
const userGenerator = fetchUsers();(async () => {
for await (const user of userGenerator) {
console.log(`User: ${user.name}, Email: ${user.email}`);
}
})();
{ "range": { "price": { "gte": 20, "lte": 50 } } }
{ "range": { "event_date": { "gte": "2023-01-01", "lte": "2023-12-31" } } }
SELECT regexp_match(column_name, 'your_regex_pattern') AS matched_text FROM table_name;
SELECT MIN(column_name) FROM table_name;
SELECT MAX(column_name) FROM table_name;
SELECT order_id, string_agg(product_name, ', ') AS products FROM order_details GROUP BY order_id;
-- Example: Match strings that end with '-dev' SELECT * FROM your_table WHERE your_column LIKE '%-dev';
UPPER(string)
LOWER(string)
-- Create a view named "customer_orders" to show orders for a specific customer CREATE VIEW customer_orders AS SELECT order_id, order_date FROM orders WHERE customer_id = '12345';
SUBSTRING(string FROM start_position [FOR length])