I have the following data: Timestamp Min MAX Category 2019-03-22 08:10 12.00 5.10 AAAA 2019-03-22 08:11 10.00 5.20 AAAA 2019-03-22 08:12 11.00 4.90 AAAA 2019-…
Tag: sql
Trouble deploying Laravel Passport with Google App Engine (GAE)
I have successfully deployed and maintained a Google App Engine + Laravel Project using Google Cloud SQL as a database. I’m using Cloud Build to deploy, however on manual deployment my problem occurs just the same. I’m trying to get the locally working Laravel Passport installation to work on Goog…
I have a table that contains a set of products purchased and their total quantities. How to get the product having minimum quantity for that month?
I want to extract the products corresponding to each month having minimum and the maximum quantity. That is for month 1 the product having the least quantity that is “Butter” should be displayed along …
Problem with delete syntax in SQL – Error Only one expression can be specified in the select list when the subquery is not introduced with EXISTS
I have this SQL query: SELECT NumeroReloj, Badgenumber, Name, lastname, DEFAULTDEPTID FROM [PBS].[dbo].[CAT_Empleados] RIGHT JOIN [AccessControl].[dbo].[USERINFO] ON [PBS].[dbo].[CAT_Empleados].[…
Use multiple IF condition to set variable
I receive parameters to stored procedure: @BDOnly BIT , @CDOnly BIT , @PPOOnly BIT , @FBOMOnly …
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. …
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 …