There is a table Saleswith data from year 2005 to year 2015 I want to query data and filter column Sales_Date with datetime data type where the year is 2013 including all other columns is this correct or there is a function specifically to filter query by year of datetime data type Answer It is not correct as…
Displaying one row with one timestamp and a corresponding x-integer array as x rows with x timestamps and one corresponding integer
Apologies for the poorly worded question, I don’t know how to succinctly describe my problem. I am working with data from a sensor that scans a room every 10 minutes to see how many people are in it. …
SQL query returns values when selecting multiple columns, but no data when selecting only one column
I can’t get data to return when selecting only one column. This column is an integer format with a column name of “date”. I’m using SQLite3. sqlite> .once table.txt sqlite> select “date”,* …
How to merge tables returned by function called in select?
I created a function that takes a nvarchar and returns a table of one column and variable amount of rows. The problem is I need to call the funcion like this SELECT fn_My_Func(V.Value) FROM …
Dividing a sum value into multiple rows due to field length constraint
I am migrating financial data from a very large table (100 million+ of rows) by summarizing the amount and insert them into summary table. I ran into problem when the summary amount (3 billions) is …
Reservation table query
when I execute my reservation table query, I get an error. Any help? This is my reservation table query CREATE TABLE RESERVATION ( NUMCHAMBRE INT FOREIGN KEY REFERENCES CHAMBRE (NUMCHAMBRE) , …
Creating tables with multiple authors, books and categories
I am currently learning database for an upcoming school semester, So I’m practicing with the books I currently have. I have books by multiple authors and authors with multiple books. Also books with …
Best way to count occurrences in a table?
I have a table with some key values occurring in one or more columns. Each value can occur zero or more times in each row. How do I efficiently calculate number of occurrences of each value in the …
Create an index that only cares if a DateTime field is null or not?
I have many tables with a nullable DeletedDate column. Every query I write needs to check that the record is not deleted, but doesn’t care when it was deleted. I want to add an index to this column, …
What is the syntax for merge-delete target rows with filter?
I’m learning SQL on Oracle Dev Gym. I’m taking the class Databases for Developers: Next Level: Merge, by Chris Saxon. I can’t for the life of me figure out how to delete rows with filter in the …