Skip to content
Advertisement

Tag: row

How can eliminate the line that counts everything [COUNT function in SQL]

I was running a code where I needed to see the top 10 results in a table. Unfortunately, I am with one more row that I was expecting. My results was the following: [Result after the query][1] [1]: https://i.stack.imgur.com/KCu7W.png Is there any way I can eliminate row 1 from my query? Thank you in advance for any assistance! Answer try

How to delete row contain specific string on it in SQL Server

There are lots of rows that contain ’08:28:00.000′ in my table,like this one: I want to delete all the rows that ‘datetime’ contains ’08:28:00.000′.Instead of deleting this kind of rows one by one,is any command can delete all the rows than datetime contain ’08:28:00.000′? Answer Try using a range delete query here, after extracting time from the datetime column:

How to calculate the average value of following n rows based on another column – SQL (Oracle) – updated version of previously answered question

I am trying to calculate average monthly value of PREMIUM for each POLICY_ID in monthly basis as shown below screenshot. When a customer updates his/her yearly PAYMENT_FREQUENCY to a value different than 12, I need to manually calculate the average monthly value for the PREMIUM. In addition, average monthly PREMIUM amount can be changed in time. For instance, for the

Advertisement