[Solved] SQL group data based on a column and pivot rows to (unknown) columns [duplicate]

[ad_1] A straight-up PIVOT in concert row_number() with should do the trick Select * From ( Select ID = fd_Interpretation ,Item = concat(‘Word’,row_number() over (partition by fd_Interpretation order by fd_Word) ) ,Value = fd_Word From YourTable ) src Pivot ( max( Value ) for Item in ([Word1],[Word2],[Word3],[Word4],[Word5],[Word6],[Word7],[Word8]) ) pvt 2 [ad_2] solved SQL group data … Read more

[Solved] find 2nd highest salary in sql [closed]

[ad_1] Use this query SELECT MIN(s.Payment), e.EmpName, e.EmpID FROM dbo.Employee e INNER JOIN Salary s ON e.EmpID = s.EmpID WHERE e.EmpID IN (SELECT TOP 2 EmpID FROM dbo.Salary ORDER BY Payment DESC) 5 [ad_2] solved find 2nd highest salary in sql [closed]

[Solved] How do I convert a SQL server timestamp to an epoch timestamp? [duplicate]

[ad_1] You can do it using DATEDIFF function like below : select DATEDIFF(s, ‘1970-01-01 00:00:00’, ‘2017-11-20 23:12:02.000’) as EpochTimeStamp Output : EpochTimeStamp ————– 1511219522 You know already how can we get back the original date : SELECT DATEADD(ss, 1511219522, ‘19700101’) as OriginalDate OriginalDate ———————– 2017-11-20 23:12:02.000 [ad_2] solved How do I convert a SQL server … Read more

[Solved] How to create a query for this scenario?

[ad_1] I think you can try this to obtain a list for all the users (left join with table user in this case is not enough – see my sample data below): SELECT C.USERNAME, A.CALENDARDATE , CASE WHEN B.USERNAME IS NULL THEN ‘Absent’ ELSE ‘Present’ END AS STATUS , CAST(B.WDT AS DATE) AS WDT, CAST(B.WDT … Read more

[Solved] How do I connect the local SQL Server database for the ASP.NET Core application running inside either local Docker or Kubernetes?

[ad_1] How do I connect the local SQL Server database for the ASP.NET Core application running inside either local Docker or Kubernetes? [ad_2] solved How do I connect the local SQL Server database for the ASP.NET Core application running inside either local Docker or Kubernetes?

[Solved] how can select all columns and one of them without rebeating [closed]

[ad_1] If you want to list the employees and the name of each employee’s department manager, you will need to join the Employee table twice. One way to do this is: Select Employees.* , Departments.* , Managers.EmployeeName as ManagerName From Employees Inner Join Departments on departments.DeptID = employees.DeptID Inner Join Employees managers on managers.EmpId = … Read more

[Solved] Is there any way to calculate age of a person based on DOB and quarter of the provided year sql server? [closed]

[ad_1] Using DATŠ•DD() and DATEPART() is an option: SELECT DOB FROM (VALUES (CONVERT(date, ‘19971207’)), (CONVERT(date, ‘19700607’)), (CONVERT(date, ‘19771207’)), (CONVERT(date, ‘19971108’)) ) d (DOB) WHERE DATEPART(year, DATEADD(year, 50, DOB)) = 2020 AND DATEPART(quarter, DATEADD(year, 50, DOB)) = 2 Result: DOB 1970-06-07 0 [ad_2] solved Is there any way to calculate age of a person based on … Read more

[Solved] What type of encryption is this [closed]

[ad_1] As mentioned by tadman, the $P$B signature suggests that this is probably a hash generated by the WordPress password hasher, so it can’t be reversed The WordPress password hasher implements the Portable PHP password hashing framework, which is used in Content Management Systems like WordPress and Drupal. You can generate hashes using this encryption … Read more