Learncado
Learncado

Learncado brings together a vast collection of questions and answers. Expand your knowledge, learn new skills, and find solutions to your queries effortlessly. Enhance your learning experience and save valuable time by exploring our website today.

Resources

  • Questions
  • Question By Tags

Help and support

  • Contact
  • About

  • Geniecourse
  • Jetsodeals
  • Rentcado
  • Dealcado
© 2021-2023 Learncado All Rights Reserved.

Search Results (714)

Results for sql-server

December 2nd, 2023
How to find a combination of two columns that is NOT in the other table in ORACLE SQL?

I have a main table that contains the data I have, and a reference table telling me what values the main table should have. I want to check if the mai...

oraclesqljoinexistsselect
Read more
December 1st, 2023
SQL cursor take too long to complete

DECLARE orderid NUMBER; customerid NUMBER; channel VARCHAR2(20); amount NUMBER; CURSOR orders_cursor IS SELECT order_id, cu...

oraclesqlplsqldatabase-cursor
Read more
December 1st, 2023
Hot to use SQL WITH VALUES clause to define constant value

In PostgreSQL I have: SELECT * FROM weather_data WHERE parameter_type = 'TEMPERATURE'; I want to write this as: WITH ParameterType AS (VALUES ('TEMPER...

postgresqlsql
Read more
November 30th, 2023
SQL-Snowflake - How to count the days between dates in 2 or more rows wtih WHERE condition

COUNTRY STORE_ID ORDER_DATE DE 990003975 2023-01-24 FR 990004963 2023-04-11 FR 990005204 2023-06-15 FR 990005204 2023-06-10 FR 9900052...

sqlsnowflake-cloud-data-platform
Read more
November 30th, 2023
How to compare rows after a particular column in BigQuery SQL?

SQL Gurus, I have got a problem and I have no idea how to solve it. I have a table like this in BigQuery: id ga_id first_date second_...

google-bigquerysqldata-analysis
Read more
November 29th, 2023
IF (CASE) THEN SELECT STATEMENT in Oracle SQL

I want to create a query in oracle that looks like this DECLARE my_count NUMBER; BEGIN SELECT COUNT(table.column1) INTO my_count FROM table; I...

oracleplsqloracle-sqldeveloper
Read more
November 29th, 2023
SQL rownumber until column value changes back

I am trying to create a column that represents how many days ago the most recent promotion started for each product. It should continue counting on wh...

google-bigquerysqlrow-number
Read more
November 29th, 2023
Convert SQL query that uses CASE expression as a JOIN key to pandas

SELECT a.year, a.country, b.amount FROM table_a a LEFT JOIN table_b b ON a.country=b.country AND (CASE WHEN b.country = 'Europe' THEN b.year = 2022 EL...

pythonsqlpandasjoinpandas-merge
Read more
November 28th, 2023
How to prevent the query from generating multiple unnecessary columns in SQL?

SQL beginner here. So I have this so far when trying to find the total time traveled based on the "generation" column: SELECT generation, SUM(...

sqlssms
Read more
November 28th, 2023
Prevent the query from generating multiple unnecessary columns in SQL?

So I have this so far when trying to find the total time traveled based on the "generation" column: SELECT generation, SUM(CASE WHEN generatio...

sqlsql-server
Read more
November 27th, 2023
Convert CHARACTER DATATYPE TO INTEGER DATATYPE in Netezza SQL

I have a table TABLE_A Which has all the column as CHARACTER DATATYPE. Let's say in one of the column I have the value like : Column_A 123 1,123 I ha...

sqldatabasenetezza
Read more
November 27th, 2023
SQL how to "join" result of two queries on the same table?

Suppose we have a table listing orders, among others one column lists the customer who bought a product, another column lists the specific product he/...

sql
Read more
November 27th, 2023
How to Define Variables in the SQL and Use it as a Column in other Query?

I have a list of products, each product has different types of discounts, I need to query during products to get products that have specific prices (a...

laravelmysql
Read more
November 28th, 2023
SQL How to select the first actor of the current movie id and or show id who has > 0 films or shows

Sort of new to PHP (8.1) & SQL (Myqli) and seriously stuck on this one. Would very much appreciate some help here. SQL Tables are as follows: $current...

sqlmysqlselect
Read more
November 26th, 2023
SQL query to search for row that has lowest difference to a search number if you have doubles on a column

Here is my situation, I have a table with these columns: FormID AbilityGenID Ability1ID Ability2ID HiddenID To search for certain records I have a q...

sqlsql-server
Read more
November 25th, 2023
SQL WHERE clause matching on the same field twice (or more). What is the right JOIN statement to be used?

I have a DB with two tables: employees table: fields = {ID, name} turnShift table: fields = {ID, date, ID_employee1, ID_employee2} Here is an exampl...

sqlmysqlselectwhere-clause
Read more
November 26th, 2023
Looping in Snowflake SQL without UDFs

In Snowflake SQL, I am trying to achieve a scenario to create array aggreagate of dates based on certain where conditions, but I am not able to achiev...

snowflake-cloud-data-platform
Read more
November 24th, 2023
sql athena/presto check if value in array of nested json

I run a query in athena like so: SELECT element_at(col_name,1).entities FROM "db_name"."the_table" limit 10; and I get an array of nested jsons/dicts ...

sqlprestoamazon-athenatrino
Read more
November 24th, 2023
SQL query to count data from specific day and time, grouped by classification

I have a database table with this data: PurchaseDate = Classification = Quantity = I need to create report on how many Quantity per day, per Classi...

sqlsql-server
Read more
November 23rd, 2023
How to tune simple sql query with group by

I have three tables 1.) Students (id,firstName,Surname,email) 2.) Course_Student(student_id, course_id) 3.) Courses (id, name, classroom_id) I need to...

sqlmysql
Read more
November 24th, 2023
SQL is group by all bad ? When yes how I rewrite my query?

I have a product table and reviews table and want to show the products with the avg ratings SELECT p.*, avg(r.rating) as avg_rating FROM product p ...

sql
Read more
November 23rd, 2023
SQL (standard) join count by several columns

I have these tables CREATE TABLE poster ( poster_id SERIAL NOT NULL PRIMARY KEY, country VARCHAR ( 50 ) NOT NULL ); CREATE TABLE batch ( ...

postgresqlsql
Read more
November 23rd, 2023
SQL (standard) join count by several fields

I have these tables CREATE TABLE poster ( poster_id SERIAL NOT NULL PRIMARY KEY, country VARCHAR ( 50 ) NOT NULL ); CREATE TABLE batch ( batch...

postgresqlsql
Read more
November 23rd, 2023
Exclude nulls from result SQL query

I have a query which returns result, contains dates mixed with null values. My goal is to remove nulls from all columns by merging values. Note: it's ...

sqlsql-server
Read more
November 24th, 2023
SQL ordering behaviour by multiple conditions

Assume we have the following People table: Name | Id | Employee type ------------------------------- Max | 2 | Engineer Alice | 3 | Scient...

sqlsortingmultiple-columnssqlalchemysql-order-by
Read more

Hot Topic

  • 25881

    How do I undo the most recent local commits in Git?

  • 11618

    How can I remove a specific item from an array in JavaScript?

  • 20343

    How do I delete a Git branch locally and remotely?

  • 7387

    How can I find all files containing a specific text (string) on Linux?

  • 7330

    How to find all files containing specific text (string) on Linux?

  • 7611

    How do I revert a Git repository to a previous commit?

  • 2671

    How do I create an HTML button that acts like a link?

  • 8481

    How do I check out a remote Git branch?