Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question In the attached scenario, one of the column “result” is showing fail in one of the row and remaining all scenarios showing it as pass.
Tag: tsql
Didnt print on Procedure on SQL
So I try to print a message when I have any confirmation or error. I have this table [Friendship] that have the ID, friend mail, their mail and the date that have been confirm the friendship, Table without data When I use the EXEC for this PROCEDURE, I have the insert values, but not the print´s acctions… Also, If I
Extrapolate Data
I have the following two tables in my database. One holds transaction data and the other holds development periods. How can I extrapolate the data into the future development periods like below? Answer One method uses cross apply:
Find Gaps in a single date column SQL Server
Good Day everyone, I need your help. I am trying to detect gaps in a single column of the type Date or DateTime in SQL Server. Say we have a list of schools and each school has many records and there is a field of uploadDate. So something like that: My outcome would be something like that: Thank you all.
Apply multiple validation to SQL records and identify all failing validations
I have a requirement where I need to capture all failing validations in SQL database. I have below table: My validation rules are as follows: Department should be IT Age should be in 20s Age should not be 25 These are sample validation and my requirement is to capture all failed records along with failing conditions, I have achieved it
Remove trailing comma
I have a table with names formatted as “Smith, Stan” and need to display them as “Stan Smith”. I was able to do that but it seems that the comma has been left behind and I need to get rid of it. This is what I currently have: Answer How about using replace as below
Assign new value to every unique number in SQL Server
I am new to SQL Server and trying to do some operations Sample data: Amount | BillID ——-+——- 500 | 10009 500 | 1492 350 | 15892 222 | 15596 899 | 20566 350 | 9566 How can …
Specific hierarchy geography
I have a table geography with three levels I need to display the level3 only for level2 = France, Benelux and for the other countries level2 = level 3 Result Example: Answer
Optimal join from a column to the concatenation of those columns?
I have a table TableLHS with a column ObjInfo: which I would like to join to TableRHS, with columns: So the join here involves 1) dropping the leading zeroes from ObjNumber, and 2) concatenating the three columns in TableRHS together. My best shot at the join is: My current performance could use some improvement. Is there a smarter way of
t-SQL cartesian production of several tables
I would like to get a cartesian product of several tables in SQL (which are actually only one column, so no common key). For example: I tried CROSS JOIN, but I couldn’t find an example with multiple tables. Is the only way to do it is nesting? What if we have 15 tables to join that way… it creates a