Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question lets say I have two MySQL tables, table A and table B. Each table has a pri…
What is wrong with my Postgres statement?
I am trying to select list of employees, but i know some employees do not have manager_id, for these employees without manager_id (null) i want the result to display “pip” while for the rest it displays original info. Answer The code you want is probably: Or more simply: The two significant issues…
how to join two hive tables with embedded array of struct and array on pyspark
I am trying to join two hive tables on databricks. tab1: The schema of “some_questions” “some_questions” example: tab2: I need to join tab1 and tab2 by “question_id” such that I get a new table I try to join them by pyspark. But, I am not sure how to decompose the array wit…
How to MySQL select from a single matching-table with multiple criteria (AND / OR doesn’t work)?
I have a very simple matching table with the following information (in real life the table contains different ids for other tables instead of fruit/colors, but the fruit example makes it easier to …
Get users which have multiple entries in multiple categories
The following query returns no results, I’m guessing because I’m ‘and’ing twice in a row on the same value. If I change it to ‘or’, then I get 2/3rds of what I need but I need users that have …
Return all records that has particular record following next to it
I have few records sorted by Serial Number and I need all records such that a record followed by another record satisfying given condition. Table student -> CREATE TABLE student (sno int, id int, …
How to intersect 2 subqueries
Hello i want to intersect 2 long Queries with each other but i found out that you can only intersect simple Queries. Is this possible to get something like this? `SELECT id, name as antibodyName FROM …
Sorting all data by date with Group By
This is my table. INSERT INTO dbo.cash_flow(date_info,expl,flow_type,currency_type,amount,flow)VALUES (‘5.10.2020′,’d8′,’gelen’,’gbp’,5000,’case’) INSERT INTO dbo.cash_flow(date_info,expl,flow_type,…
t-SQL cartesian production of several tables
I would like to get a cartesian product of several tables in SQL (which are actually only one column, so no common key). For example: I tried CROSS JOIN, but I couldn’t find an example with multiple tables. Is the only way to do it is nesting? What if we have 15 tables to join that way… it creates…
Insert into select SQL with windowsForm
I want to insert some data in Table1 in my database selecting it from another Table2 but the Table1 has another attribute for username (ComputerName). What I have tried: Answer I think you are looking for something like this :