Skip to content
Advertisement

Tag: sql-server

SQL Server full-text search gets only one value

It only gets one value back is it possible to get multiple values inside? Like get test, test1 and test2. Answer Looking at each of the three fully visible example rows: ID=25 No match, because IsDeleted is 1 ID=26 Match. This is the row you see in the results. ID=27 NO MATCH, because Contains() matches full words by default. This

Understanding How to Parse SQL Solution

I am working on the HackerRank Top Earners problem. The problem states the following: We define an employee’s total earnings to be their monthly salary x months worked, and the maximum total earnings to be the maximum total earnings for any employee in the Employee table. Write a query to find the maximum total earnings for all employees as well

How can I generate an ID column for a column in SQL? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 6 months ago. Improve this question I have a column that I’d like to generate an ID column for. How can I do this using SQL?.

get dates periods

it is necessary to get the date periods. input data: expected result: Answer This is a gaps and islands problem. One trick we can use here is to create a pseudo-group which tracks to which island of continuous dates each record belongs. Demo In the first CTE above, the alias cnt gets assigned to a value of 1 whenever the

Simplify SQL query with string as array parameters

I’m trying to find a way to simplify my stored procedure. When I try to query using single parameter it went well but when using array, the retrieval process took so long. Any idea how will I simplify this? Someone suggested to me to put StringAsArray into temp table but I don’t know exactly what they’re trying to suggest. Any

Advertisement