I want to do a special query to evaluate team members. Each member will have a score, and those with score that is greater than 80th percentile of that team’s score will get a bonus. However, I want …
WHERE conditions in SQL (ORACLE)
People, I need a help. I have the following code: … WHERE res.cod_ordem_producao = pla.cod_ordem_producao — TO MAKE THE JOIN AND (to_char(:codordemproducao)=’X’ — INITIAL VALUE FOR THE …
How to compare trimmed variable in SQL statement?
I have a SQL statement which includes three database tables. I am comparing some IDs and DESCRIPTIONs and now I need to compare results FIRSTNAME, MIDDLENAME and SURNAME. SELECT …
using “INSERT INTO” statement in php code doesn’t work
I’m trying to build a database for a bookstore with 3 tables: Book, Volume and Publication. version 2 : I could make some corrections in my code and database thanks to previous answers and this one …
Can PostgreSQL JOIN on jsonb array objects?
I am considering switching to PostgreSQL, because of the JSON support. However, I am wondering, if the following would be possible with a single query: Let’s say there are two tables: Table 1) organisations: Table 2) users: Now I want to get a result like this (all i have is the ID of the organisation […
Using Pivot function In SQL Server
I have the below table Code Data SL Payroll 1 GV Payroll 3 Global Payroll 1 TimeHCM 1 SL Payroll 0 GV Payroll 0 Global Payroll 0 TimeHCM 0 SL …
Converting db2 column names in select to be lowercase in json file
I currently have a very simple select that my code then dumps into JSON SELECT user, phone FROM table t; But the select returns all uppercase column names, resulting in uppercase JSON keys, which I …
How to get count of Rows automatically when a New Row is added and Rows are to shown as Columns in SQL Server
I am using this query: SELECT * FROM tbcount PIVOT (COUNT(Id) FOR Name IN (F1, F2, F3, F4, F5, F6)) p and result is F1 F2 F3 F4 F6 9 9 8 8 8 But I have kept F1 TO F6 fixed I want that …
SQL Server : select all rows where Column does not contain any value from dynamic table of values
I’m using SQL Server 2016. I am searching TableA and want it to not return any rows where one of the terms from TableB exists in a particular column of TableA. Assume I have the following sample …
How to create procedure for pagging in sql server with OFFSET? [closed]
I want to create a stored procedure to fetch data by PageIndex and PageSize using OFFSET ROWS