gaps-and-islands
Find the start and end date (set based) in T-SQL
I have the below. NameDate A2011-01-01 01:00:00.000 A2011-02-01 02:00:00.000 A2011-03-01 03:00:00.000 B2011-04-01 04:00:00.000[详细]
2023-02-03 03:43 分类:问答tsql intesect between 2 datetime recordsets
I have an appointments table with appointments for a number of \'resources\' what i need to do is query that and return (for a particular resourc开发者_开发问答e) all free appointment slots across a d[详细]
2023-01-30 00:53 分类:问答How can we find gaps in sequential numbering in MySQL?
We have a database with a table whose values were imported from another system. There is an auto-increment column, and there aren’t any duplicate values, but there are missing values. For example, ru[详细]
2023-01-29 02:42 分类:问答sql group by only rows which are in sequence
Say I have the following table: MyTable --------- 1 | A | 2 | A | 3 | A | 4 | B | 5 | B | 6 | B |[详细]
2023-01-28 00:30 分类:问答How can I force SQL Server Group By to respect column order when grouping?
I am using SQL Server 2005. SEE END OF THIS POST REGARDING BAD TABLE DESIGN. I have two columns. I would like to group by the first column with respect to the order of the second column. Microsofts[详细]
2023-01-19 06:44 分类:问答SQL query: finding a gap in a primary key
How can I write a single select statement that does the following: I have an integer column in my table and i want to find the minimum available (non-used) value in that column where the value is bel[详细]
2023-01-19 02:09 分类:问答Iterating through dates in SQL
I have a table of data that looks a bit like this: NameStartTimeFinishTimeWork Bob2010-08-03 08:00:002010-08-03 12:00开发者_开发问答:004[详细]
2023-01-14 19:03 分类:问答sql query distinct
My database record is as below:- cartidorderidfoodidqty ============================== 92107开发者_JAVA技巧51[详细]
2023-01-13 04:32 分类:问答Retrieve missing dates from database via MySQL
So I have a table where I collect data for the jobs that I do. Each time I create a job I assign it a date. The problem with this is the days I don\'t have jobs aren\'t stored in the database therefor[详细]
2023-01-02 03:18 分类:问答MySQL to fill in missing dates when using GROUP BY DATE(table.timestamp) without joining on temporary table
after reading through a couple similar Qs/As I haven\'t quite found the solution I\'m looking for. The table data I have is GROUP BY DATE(timestamp) and returning a count, example result:[详细]
2022-12-31 00:30 分类:问答