I receive parameters to stored procedure: @BDOnly BIT , @CDOnly BIT , @PPOOnly BIT , @FBOMOnly …
Date filter function with SQL doesn’t work
I have a website where I load various activities who all have a specific date. I want to filter on those dates. I do that with this query: function selectAllActivities($date = false){ $sql = “…
Simple Syntax Error in SQLite: “Error near line 1: near ”SQLite”
I am having a great deal of trouble with this seemingly simple issue. I can’t seem to get .read to work. Here is the code that I have tried: Any help would be greatly appreciated!
Is there some way to set a date pattern and force a specific day?
I have a complicated select with a lot of inner case within case within case statements to try and figure out the right date, but after all is figured out, it needs to use only the first day of the …
SQL View slow when filtered. Is there a clean way to improve performance?
Let me open with: SHOWPLAN permission denied in database ‘MyDatabase’. With that out of the way, I’ll layout my situation. So, The database I work with has a view that executes fairly quickly. …
Remove one, non-unique value from a 2d array
To expand on my answered question here: Remove one, non-unique value from an array Given this table in PostgreSQL 9.6: CREATE TABLE test_table ( id int PRIMARY KEY , test_array text[][] ); …
How can I seperate one column into multiple columns depending on their value when selecting it?
I have a table called assignment_answers, which has the following attributes: assignment_answers_id, question_id and order. The order is an attribute, which can take a value from 0 to 9. I would like …
Query returning data outside the scope of the WHERE condition
I’m trying to retrieve summarized data from the table depending on DateTime and state. The problem is I need multiple state values ex. ‘where 1 or 2 or 3’ SELECT SUM(ticketTotalAmount) FROM tickets …
Can I declare and use variables “inline” in Oracle SQL?
can I do something like this pseudo code and use variables inline within the select? I know that in this case variables are not needed, I have a more complex use case in mind. select t.foo, t.bar, …
Selecting Max Value, However Prioritising Certain Values
I have three tables that are joined. TableA has unique values for Column1 (ID) which joins on TableC on Column1 which has non-unique values. I’m currently joining these based off the max value for …