my query might sound simple to most of you but it did hook me up for quite a time now! table **user** +—-+——-+ | id | name | +—-+——-+ | 1 | Sanam | +—-+——-+ | 2 | Raj | +—-+–…
Passing in Variables in Python to SQL Query
When I run the SQL query below I get the error print(db.execute(“SELECT * FROM (?);”), (tableName)) sqlite3.OperationalError: near “?”: syntax error db = sqlite3.Connection(“:memory:”) db.execute(“…
Need to select 2 most recent dates for 2 id’s
I need to return 2 most recent dates for each client id, i have 12345 and 112233 and for each of them i need to create a function which supposed to return to me this id | client_id | created …
Calculate the numbers of week names
I tried to edit but I have not knowledge about the number of weeks: declare @from datetime= ‘2019-06-01’ declare @to datetime = ‘2019-06-19’ select datediff(day, -3, @to)/7-datediff(day, -2, @from)…
How to display each row from sql in a table in php
I have a table within a modal. I want the table to display the top 3 goalscorers from a football game. The following code is not returning the table. Any help greatly appreciated!. At present I am …
How to ignore few properties in SQL Server JSON value
I have a table which has a column with JSON data. Every JSON object in each column has many properties. I have another table which has property name not all but few. What I need to do is to write a …
Pulling another row if it meets criteria from the first pulled row
Need to compare some accounts, which some people have two of, an admin account and a regular account. These admin accounts list their regular account as their manager and all of the admin accounts …
Students who are passed in all subjects and having total marks greater than 170
SQL> select * from marks; STUDENTID SUBJECTID MARK ———- ———- ———- 1 1 **21** 1 2 75 1 3 87 2 1 …
How can I solve a performance issue in my stored procedure?
I have a performance problem with a stored procedure. Because when I check my benchmark’s result I realized that “MatchxxxReferencesByIds” has ‘240.25’ ms Average LastElapsedTimeInSecond. How can I improve my procedure? Answer Based on the execution plan of the stored procedure, …
mysql – GROUP_CONCAT rows into a string
I have a following result set: req_id | p_id | ai_result | hash | sku 1 | 4 | Match | XAN | HOW 1 | 4 | Match | HXN | HOW 1 | 4 | Non Match | 123 | …