Sql query – getting rid of hard-coded values

I can think of at least two options… Or… Both let you have multiple different sets of constants. One is expandable without changing the schema, though the query still would need to change. The main advantage of either approach is that you can re-use the constants else where, but store them once in a centralised … Read more

SQLite – UPSERT *not* INSERT or REPLACE

Assuming three columns in the table: ID, NAME, ROLE BAD: This will insert or replace all columns with new values for ID=1: BAD: This will insert or replace 2 of the columns… the NAME column will be set to NULL or the default value: GOOD: Use SQLite On conflict clause UPSERT support in SQLite! UPSERT syntax was added to … Read more

Oracle Apex column link from LOV values

I’m mostly used to Apex 4.1, but this approach should work. You don’t need an LOV. Your report query should include both the MAST_ID and the TASK_NAME columns. Hide the TASK_NAME column and set MAST_ID as the linking column. If you set the Link Text (under Column Link) to #TASK_NAME#, you should get the desired result. Display As should be left at the default (Display as Text etc).

SQL – HAVING vs. WHERE

WHERE clause introduces a condition on individual rows; HAVING clause introduces a condition on aggregations, i.e. results of selection where a single result, such as count, average, min, max, or sum, has been produced from multiple rows. Your query calls for a second kind of condition (i.e. a condition on an aggregation) hence HAVING works correctly. As a rule of thumb, use WHERE before GROUP BY and HAVING after GROUP BY. … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)