The following query works perfectly: It returns two row each with two dates Instead of returning these two values in a table, I’d like each row to also have the difference of those two dates, in years or days. So I have two questions: What’s the general rule for combining columns? How do I subtrac…
SQL Collect duplicates to one place? PostgreSQL
Sorry I’m new here and I’m also new with SQL and can’t really explain my problem in the title… So I have a TV show database, and there I have a Genre column, but for a TV show there are multiple Genres stored, so when I’m selecting all my TV Shows how can I combine them? It needs…
Performing a JOIN with the results of a WITH clause
I have one query that uses one join already, call it query1. I would like to join query1 to the results of a WITH clause. I don’t know how to merge the two data sets. Query 1: SELECT p….
SQLDeveloper – Check for a column within another column
I am currently trying to query if a Last_Name column has the suffix added to the end of a Last_Name. I have a Suffix Table(SUFFIX) which stores the available suffixes (I, II, III, IV, V, Jr., Sr.) however I am running into trouble when I have performed the below query as it shows all the last names even if it
Trying to compare date in different rows in Bigquery
I am using Google Bigquery to compare date field on two different rows, like this: Table I would like evaluate the rows that have the same ID and are more than 30 minutes beetween them, but I am not …
difference between ‘where’ null and ‘on’ in a left join
Could someone explain to me why select “talent”.* from “talent” left join “push” on “push”.”talentId” = “talent”.”id” where (“push”.”offerId” = ‘403’ or “push”.”offerIdR…
Flatten multiple names arrays within variant json column in snowflake
I have a web scraper dumping data into a variant column in a Snowflake database. This is acraping page data as then creates json arrays for various tables found within the page. Here is an example of the type of json i would find using a Soccer analogy: Ideally, i’d like the output of this to be a flat,…
Date format conversion to YYYY-MM-DD HH:MIN:SEC in Apache Hive
I am loading data to a hive table from a csv file. File is having a field named last_updated_date and it’s value is in format “20200412013000771+0000”. I need to covert it into “YYYY-MM-DD HH:MIN:SEC”….
Query to get all siblings
I have table like that: ID NAME SURNAME MotherID FatherID 0 JJ smi NULL NULL 1 ja rly NULL NUL 2 ak smi 0 1 3 ol smi 0 1 …
using alias to where clause query mysql
i have query but mysql showing this error: Unknown column ‘Aktifitas’ in ‘where clause’ why mysql Alias cant be use in Where clause, but is there something I missing? Thanks in advance. Answer You can’t use column’s alias in where clause you must repeat the code (because th…