Skip to content

Find the remainder of the number in a new column in SELECT statement

I am building a program in which the user enters a value, either negative or positive, and this value is added to the table, and through the SELECT statement, those values are stored and the remaining values are found in a new column, and at each entry, the data of the DataGridView is updated. Example: Date N…

Oracle SQL: ORA-01858 error on date fields

I have many tables with a date in their name. For example MY_TABLE_2021_06_01, MY_TABLE_2021_06_02, etc. I’m trying to extract the date from the table name and see if any tables are more than an year old. This is my code: The above code works fine if I don’t include the where clause where table_da…

The difference between OUT and OUTPUT

In an application that uses SQL Server I came across a code that uses both OUT and OUTPUT parameters. What is the difference between OUT and OUTPUT parameters. Answer As noted in the comments, the 2 are synonyms. From the documentation the syntax for the clause is listed as below: So this denotes that either …

Extract desired substring from a string

I want to remove all the raw data before and after the specific tag. e.g I have data in a variable like declare @getdata varchar(max)= ‘ –uuid:674de154-e967-4153-84a4-549525203f52 Content-Type: …

Error getting SQL reservations and availablity

I am trying to find the rooms which are not booked from the yyyy-mm-dd to yyyy-mm-dd. I am getting the rooms which are booked technically. How to invert the result? My reservations: This is my rooms …