Skip to content

SQL query to combine the results from two tables

I have these two tables and I want to build a SQL query: My search criteria is: Name (in field Brother and field Speaker) Congregation (in field Congregation in both tables) I want the resulting view to be a single list of all records, sorted by date (fields Talk Date and Last Given). So: Away Talks I am inte…

Problem using create view and explain plan

I want to test the efficiency of this query using explain plan for. The query works without the explain plan but when I use it I get this errors: I used explain plan on queries without create view and they worked. I don’t know what is causing the error I have tried changing the parenthesis but I get the…

Create table which shows earliest and latest date for same names(IDs)

So from my table where I have columns: name, date I would like to select names that repeat point out how many times they repeat and then from the rows with same names I want to print out earlies and latest date for that name. After all my table would have columns: name, how many, earliest date, latest date I

Oracle SQL null row order

I have the below table: Name (null) Name1 Name2 Name3 (null) Name4 I would like to generate this output: Name Output (null) Anon1 Name1 Name1 Name2 Name2 Name3 Name3 (null) Anon2 Name4 Name4 With the below query, I’m able to generate the below table Name Output Name1 Name1 Name2 Name2 Name3 Name3 Name4 …

Is there any diff between the results of the following tables?

Basic information:Ollivander’s Inventory from Hacker rank is there any diff between and and why we need to join the original table itself to get the right result? I tried to use Product table from w3schools, it returns the same result except the order of data. Answer Obviously the two queries look diffe…

Join date to date range SQL

I have event on the calendar table as follows And I have a table daily as follows I would like to join these table to get the daily with the new column of event name base on specific country, for example: I will consider only US event. So the expected output should be the following table. May I know how