Probably confusing title but I’ll explain. I have this table named Shelf: And as you can see there is a field named MovieID, it’s value is being incremented from an API and basically everytime I use this query “INSERT INTO Shelf VALUES (null,?,?,?,?)” if I try to add the same movie twice it will do it, and I don’t want
Tag: sql
Is XPath the same as Linq? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question I studied the concept of XPath and xml but did not understand how they relate to what XPath is designed to do as a query
Can’t execute a while clause in SQL Server with Dbeaver
I am trying to execute a loop while in Dbeaver with SQL Server, but the statement keeps loading and does not execute it. I just want to print the word ‘ok!’ 3 times. I’m not sure if it’s a loop problem, a Dbeaver problem, or another. Can anyone help please? My code: Screenshot from Dbeaver Answer @cnt never increments, so
How to update only one of duplicated rows in SQL without primary keys?
I have a table that have the following columns: st_id sbj_id desc scr sbm_dt 2001 10 Q2 7.4 2021-05-03 17:03:32 2001 10 Q1 8.0 2021-04-03 18:07:35 2011 10 Q1 5.0 2021-04-03 19:07:35 2001 10 Q2 7.4 2021-05-03 17:03:32 I want to update the st_id value on the last row of the table to 2011. How can I update only one
Can Someone help me write a query to determine which team lost a match AND a separate query to count each teams losses
I have tried the following code. I have attached an image of the table I am working with. I am working in Microsoft access. I am still very new to programming and I am trying to do this for a school project. Answer If you use MS Access you can use the IIF function to get the first result Please
Save listbox to SQL database, “Procedure or function Music_Add has too many arguments specified”
Here is the stored procedure on my DB. I want to save data of list to my SQL database, i can save one data, but when i try to add more it caused error like this “Procedure or function Music_Add has too many arguments specified”. Can someone help me how to fix that error… Thanks… Here is the code to
delete data only between may 6 and may 18, 2022
I have a table with CLIENT_CONTACT data, where there is call data from 2020 to today. How can I delete data only between May 6 and May 18, 2022, did I write correctly? Answer did I write correctly? Maybe…. in Oracle, a DATE is a binary data type consisting of 7 bytes representing century, year-of-century, month, day, hour, minute and
Why is this query not able to execute?
The query goes on without executing, any ideas on how I can help it resolve? Using the Economy Data Atlas dataset from Knoema within Snowflake. Answer This might be a case where temporary tables will help your what I assume is a massive table be pruned (aka one of the reasons to avoid complex CTE’s) I would re-write your SQL
MySQL ignore NULL Value while using LAG() function
I want to calculate the MonthByMonth difference of payments happening throughout the year. For example, if I had 100 payments in February & 120 in the month of March, the difference would be 20. I have already made a query that uses LAG(), but the only problem I’m facing is that the query is showing NULL Value. Since there are
How to make mysql function that return from the select result?
I want to create this function on mySql 8. It will create a sequence number like 00001,00002 i dunno whats wrong with this query but i always got this error. I also tried with this query. but still gave me with the same error. What could go wrong with my function query ? Answer Multiple datatype convertions are excess –