Skip to content

Tag: sql

Java to SQL Server using Windows Authentication

I am trying to connect to a remote SQL Server DB from a Java application without success. I am able to successfully connect to that SQL Server instance from a SQL client for Mac called SQLPro for MSSQL However, if I try to connect from the Java application using those same credentials, I always get a Login fa…

selected splitted value in oracle

I have two columns A, B in oracle where A value has values like that xx-target-xx xx any data but target is exists i neet to return only ‘target’ from text i tired this but the result returns xx not target Answer Use REGEXP_SUBSTR. You want the second string of any characters except the minus sign…

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 . C…

Finding Percentage of Unmatching Records

There are 2 tables, hometown (showing the hometown) and residence (showing the places that the residents live in the past 10 years). I want to find the percentage of the residents that lived or is living out of there hometown. A resident can live in multiple places, and the state_of_residence can be duplicate…

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