Category "sql"

Grouping Nested Query BY CASE OF ALIAS

I am trying to use a GROUP BY statement that would count each of the progress grades: SELECT with_avg.*, CASE when T_Points = Average then 'On Target' when T_P

Oracle SQL how to export null values

in relation with how to copy the records from output of oracle SQL developer to excel sheet I'm using Oracle SQL developer. I've some queries which get some nul

I need to group (tbl_types.name AS type) in a same row (postgres 14)

I need help with a select in postgres, I need to group X types into a single line, for example: type: multiple, trully, I need help on the type column SELECT tb

How Hibernate process '?' [duplicate]

I'm new in Hibernate. I can't understand how Hibernate process ? in Restrictions.sqlRestriction() method. For example, there is a sample from

Postgresql req.query returning everything instead of what is being queried?

My getByTitle query doesnt seem to work, all my other routes and models work perfectly using params. Not sure what it is I've written wrong? For context this is

How can I download all tags in the 'Posts' table?

If I write "select Tags from Posts WHERE Tags IS NOT NULL" on site https://data.stackexchange.com I can only download 50,000 rows. How can I get all rows?

SQL-how can i product/ multiply across partitions with window functions

The input I have is composed of the following columns: time, UseID, and value. I want to get the plt column as the product of successive numbers. I know about t

SQL User-Defined table Type in INTO statement

I want to Create a table @tablename with data from a User-Defined Table Type but I get the error Must declare the table variable "@tablename" ALTER PROCEDURE

SFMC date timezone

Can we convert Dataview Sent/Open CST date to UTC timezone without using dateadd funtion. Any other timezone related function?

Laravel Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) on a sub query with "ROW_NUMBER() OVER PARTITION"

I know there are tons of question that includes that error, but I haven't seen one that incldues a subquery with row_numbers. Ok so I have this raw query which

How to get records that has relationship with all records in another table in many to many relationships in MySQL?

I am using Laravel 8 and MySQL8. I have these tables: products id - integer name - string factories id - integer name - string factory_product

Codility PostgreSQL Question: Aggregation and conditionality in SQL query. Completely Stuck

I have been applying for Junior DEV roles and encountered a problem on a Codility take home test that I aced... except for this question. Which I bombed. I have

MariaDB. Create a trigger that deletes rows from a table older than 15 days

I want to create a database trigger that deletes automatically rows where the value of happened_at field is older than 15 days. My table rows id int(11) site_id

Join tables on dates, with dirty date field

In AWS Athena, I am trying to join two tables in the db using the date, but one of the tables (table2) is not clean, and contains values that are not dates, as

How we can use mutimap_agg function in spark sql and also suggest if any equivalent or alternative function to this

Can anyone help how multimap_agg function in SQL and can be used in spark sql

Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login failed for user 'sa'

I am trying to execute one stored procedure using 'sa' user through perl script save this line in a perl file and execute that perl file system("start /wait s

SQL Server trigger for verifying date column doesn't work

I have a table for scheduled surgeries and I am trying to write a trigger that will print a message in case the user inserts a past date in the date column (in

Duplicate and Split Row based on value by using SQL Query?

I have set of data and wants to split multiple rows based on the column value. For Example, Source Data: Expected Output: Thanks, Lawrance A

Recycler chat Pagination add new message at top

I am working on a chat app where I need to show reverse pagination and show the user's previous chat when the user scrolls up. I am first loading data from SQL

PowerApps Data Source Changed to Stored Procedure

The data source in PowerApps gallery was a SQL View. Search('[dbo].[vwCandidate]', textSearchCandidate.Text, "NameLast", "NameFirst", "MiscellaneousTags", "Ema