What is the query that will show all the records that have multiple names? For example. Table 1: Desired result: Answer You can use GROUP BY and join result to origin table
LIMIT and OFFSET returning repeating results
There seems to be a bug in my query that causes results to repeat when I increment the OFFSET value. It is supposed to show 20 results per page. Only 3 results match what my query is looking for, but for some reason, some of these results repeat themselves even though they should only appear on the first page…
How to join all keys correctly / How to identify join keys
so I’m having problems with creating tables, join, or at least I thought, when joining multiple tables resulting in duplicate result. I have one big table which contains all the data. Also, I have …
Calculating win streak from list of fixtures
I have a table fixtures with a list of matches played between two players in each, identified by their ID. I’m trying to use the table to calculate rolling winning/losing streaks for each player, but I’ve been having issues with my query below (see more on SQL Fiddle): Below is the desired result,…
Return only ALL CAPS strings in BigQuery
Pretty simple question, specific to BigQuery. I’m sure there’s a command I’m missing. I’m used to using “collate” in another query which doesn’t work here. Desired return: JOHN@EMAIL.COM,STACY@EMAIL.COM Answer Consider below If applied to sample data in your question …
How to get mean of exams by client with 2 tables?
I know a little bit of sql, only the basic, now I need to create a analytic query but can’t do this yet. I have 2 tables on my db oracle, client and exams: I am tried a lot of ways to get the mean of exams by client, but no success yet.4 The result expected is: exams = 13
Between the time in SQL Server and ASP.NET
I am storing STARTTIME and ENDTIME in a SQL Server table by using ASP.NET webform. Now, as you can see in the row with timeTableID = 2, the inserted time value is 8:00 & 8:30 AM, But in the row with timeTableID = 3, the inserted time value is 8:15 & 8:25 AM, I don’t want this because its within
Based on previous records, stop sum fields
I have a table like this: My goal is to obtain sum of points from date now to date that the point is greater than equal to 1 and stop sum of fields before that date. In the example above (order by date), the answer is sum of points date now(2022/01/06) to the date 2022/01/04 and equals 9 + 7
What does INTERVAL ‘182’ DAY(3) mean in SQL / Oracle?
Trying to understand INTERVAL and DAY(3) usage in SQL, as I’ve come across it and need to understand what it means. It’s in a WHERE clause, seen below WHERE POSTING_DATE > CURRENT_DATE – INTERVAL ‘182’ DAY(3) Help needed, thanks! Answer From the documentation: INTERVAL DAY TO …
Passing Variable to SQL insert statement
I know this code here selects columns from one table and inserts it into another table. However, I have a value that I want to insert into one of the columns, how do I pass in the value? This selects from on table and inserts into another… However, I want column1 to have a value that I set above the