I want to: SELECT T.TournamentId, Sum(Score) as Score FROM Tournament T LEFT JOIN Scores S on S.TournamentId = T.TournamentId WHERE T.TournamentId = x GROUP BY T.TournamentId When I choose a …
Use select inside ‘filename’ property of utl_file.fopen
I have a procedure that extracts data from a view and stores it on disc in CSV format. I’d like a name of the file to contain the most recent timestamp from table MY_TIMESTAMPS. For now it looks like this: The part with (select to_char(max(EVENT_TS)) from MY_TIMESTAMPS) throws an error. How can I set th…
R: How to use “NOT IN” logic in R
How can I convert below sql query to R Logic: SELECT * FROM FRUITS WHERE (ID||TYPE||DATE) NOT IN (SELECT (ID||TYPE||DATE) FROM SEASONAL_FRUITS)
How to read value from mysql database based on condition?
I am doing a Java project to allow users to either log in as an admin or user based on what they selected from their account creation. I managed to do a code to check if their username and password …
Insufficient user permission performing an operation on Sql Server Azure
I am trying to re-run migration on a newly created DB in azure. DB, User, and all privileges were created from scratch. I basically granted all operation permission to the user including DB admin …
create a query that fetch data as XML more faster with filters
i’m using SQL server 2014, trying to get xml from SQL server in an hierarchical structure, ` WITH parent as (select ModelId,ParentIdFK,ModelName,Expanded,SortOrder from model where NodeLevel = 0), …
Efficient way to simultaneously calc AVG and stddev_pop in postgres
stddev_pop() must be calculating AVG() as part of the full calc of standard deviation (unless there’s a shortcut I’m unaware of). for context, the goal is to test for the difference of means between …
Count the number of times word appears in a single column
I’m attempting to count the number of times apples and oranges appear in my fruit column. The table looks like this: Expected output: My code thus far. I’m not sure how to do it when both appear and how to add them to the totals. I’m sure there is an easier way that this. Cheers Answer If th…
How do I extract a value from an XML column in SQL Server
I have a column SCORERESULTS in table CSE_ARCHIVEDCREDITSCORE. Score results is an XML column. <Profile id="Navigation" version="1" num="4" …
Is there a way in SQL or Power BI where I can define jobs and figure out the time it takes to do a job and then time in between jobs?
In the table below, there are job activities and unique identifiers under lodnum. I’m trying to figure out a way to get the time difference in between a job. A job such as pallet move has two entries. …