Skip to content

Tag: join

SQL Join ON clause valid referencing on aliases

I am generating an SQL query and I need to get the data from a JSON stored on a field of my table. It goes something like this So basically I am trying to get put a connection with tables creation and lookup_detail through field FACILITY_DATA which has JSON data and alias of loanType to reference against DETA…

Order of tables in INNER JOIN

Going through a book, Learning SQL by Alan Beaulieu. On topic of inner joins, it tells that whatever be the order of tables in a INNER JOIN, results are same and gives reason as follows: If you are confused about why all three versions of the account/employee/customer query yield the same results, keep in min…

mysql: Select all rows and compare with other table

I have two tables and need to get all rows from the first one and then check which values from the second table match the first table. My goal is to get all so called ‘achievements’ and then check which one the user has reached. achievements achievement_user My desired result for a query where I c…

Joining on 3 csv files

I need to retrieve data from 3 different CSV files (Adres.CSV, ID.CSV and Regios.CSV) and combine this in an Excel table. This SQL statement works fine, StrSQL = “SELECT ID.[ID], Adres.[Naam], …

SQL COUNT with condition and without – using JOIN

My goal is something like following table: With two simple selects I could gain this values: (the key of the table consists of 3 columns [t$ncmp, t$trav, t$seqn]) How can I join these statements? What I tried: I tried different variantes, but always got errors like ‘group by is missing’ or ‘…