I’m developing a project in which I have to use a database to store data from a cinema. One of the tables stores some movies data(movie name, duration actors, etc) and it has a image column; I left it …
Tag: sql
One select statement with multiple Group BY on the same column
I have ‘TABLE_A’ like this: TVA Amount InvoiceID ———————- 22 | 10.00 | inv-12 22 |-14.00 | inv-13 25 | 24.00 | inv-14 25 |-36.00 | inv-15 25 |-25.00 | inv-16 25 | 18.50 | inv-…
Why isn’t GROUP_BY returning the desired records?
Given a table of: invitations (id, created_at, type, email) Given the following query: SELECT DISTINCT email_address FROM invitations WHERE type = ’email’ AND date(created_at) in (curdate() – …
How to update two columns in one column with two different ID and different value in single SQL query?
I have a table Item: id | price —+——– 1 | 20000 2 | 30000 3 | 40000 4 | 43000 How to update the price column id(1) = 1000, id(2) = 2000 in a single SQL query?
Read the sql files by Exclude the list of files from sql table and Execute all the files in a single Transaction using PowerShell
I have not an Expert in power shell. I Need a script/Approch which handles the below requirement. I have list of files in a folder and the file Names like below. 001_File.sql 002_File.sql 003_File….
How to add Conditions on SQL Percentile Window function?
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 …
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 …