Keeping it simple and how to do multiple CTE in a query
I have this simple T-SQL query, it emits a bunch of columns from a table and also joins information from other related tables. … Read more
I have this simple T-SQL query, it emits a bunch of columns from a table and also joins information from other related tables. … Read more
I want to convert a string like this: ’10/15/2008 10:06:32 PM’ into the equivalent DATETIME value in Sql Server. In Oracle, I would … Read more
like when I do SELECT [Date] FROM [FRIIB].[dbo].[ArchiveAnalog] GROUP BY [Date] how can I specify the group period ? MS SQL 2008 2nd … Read more
I’ve heard that you should put columns that will be the most selective at the beginning of the index declaration. Example: CREATE NONCLUSTERED … Read more
WITH y AS ( WITH x AS ( SELECT * FROM MyTable ) SELECT * FROM x ) SELECT * FROM y Does … Read more
I am involved in a data migration project. I am getting the following error when I try to insert data from one table … Read more
I have a table listing people along with their date of birth (currently a nvarchar(25)) How can I convert that to a date, … Read more
Suppose I have a table with a numeric column (lets call it “score”). I’d like to generate a table of counts, that shows … Read more
I was wondering if it’s possible to do something like this (which doesn’t work): select cast( (exists(select * from theTable where theColumn like … Read more
This question also has the answer, but it mentions DB2 specifically. How do I search for a string using LIKE that already has … Read more