Skip to content
Advertisement

Tag: sql-server

How to generalize the JSON in stored procedure?

In my database, I have table called library which have columns like dependencies, email, alert, skipped and values are stored as I want to prepare JSON of these values which will look like as I have written have code as And my JSON doesn’t look like desired JSON I am not able to achieve correct json . Can someboby please

I want to get the updated Salary by EmpID

I have a column EmpID and Salary. I want to get the updated salary each EmpID. FIGURE 1 : ID EMPID Salary 1 00000 75000 2 00000 80000 3 00001 75000 4 00001 90000 5 00001 91000 6 00010 50000 7 00010 60000 8 00010 70000 This is my initial query that I created with specific EMPID 00000 : The

Split multiple strings in SQL

I am trying to split multiple columns of strings at the same time. My original data looks like: Table1 UserID Type ProductID 1 A, B 001, 003 and I want to end up with UserID Type ProductID 1 A 001 1 B 003 When I use I end up with this table that I do not want… UserID Type ProductID

Query with Group and name sorting

I am trying to build a SQL query that is bit more complicated to what I am used to writing. Example data: So far I have a working query Currently it will return But I would like that query to always returns the names with biggest event_id, so good results would be “[Lpr] abc” and “[Lpr] Name B”. Answer I

Advertisement