I am trying to get my program to work, it is using parameters in an SQL query to add it to the database. When I run the program it comes up with “datetime conversion failed when converting date or time from character string”. I have tried many types of coding to make it work and all have failed. T…
Tag: sql
SQL how to fill out first line of group with value and other values to null
Actually i have a select statement which contains a group by I would like this : How to do that (test value fill in first row group) with sql (pgsql) ? thanks ! I tried Partition by… Answer demo:db<>fiddle Enumerate all records of an ordered group to find the first one using the row_number() windo…
Result of ‘File.createNewFile()’ is ignored
I’m not sure why this is but in my IDE, for file.createNewFile(); I’m getting Result of ‘File.createNewFile()’ is ignored for it which I’ve no idea what I should be doing Answer Static Code Inspection in your IDE for createNewFile might be complaining this because createNewFile r…
avg value from a sql table
I have a MySQL table called track_e_exercises where is stored attempts in a test, every row is a new attempt. I want to know how to obtain the avg attempts in the course per person. How can I make that? c_id is the course id column and exe_user_id is the user id column. expected result for c_id=7 => (# of
Is there a way to filter rows in BigQuery by the contents of an array?
I have data in a BigQuery table that looks like this: My question is, how can I find all rows where “key” = “a”, “value” = 1, but also “key” = “b” and “value” = 3? I’ve tried various forms of using UNNEST but I haven’t been ab…
Distincted ids for grouped values
I want to count the distinct ids in each numb and store them in a column : Tried this: Receive this output: As you can see COUNTER columns has the count of distincted ids but for all NUMB I want to output this: 1515 has 2 ids 1921 has 1 id 2121 has 2 ids I tried also to place
How to count unique data occuring in multiple categorical columns from a pyspark dataframe
The Problem: In a ML based scenario, I am trying to see the occurrence of data from multiple columns in an Inference file versus the files that were provided to me for Training. I need this to be found only for categorical variables, since numerical attributes are scaled. The Expectation: I’ve got some …
How to Return paper title and number of authors for each paper using sql
I try to return paper title and number of authors for each paper,names of authors who have at least two papers and List names of authors who have co-authored with Dr. Chen. but i don’t find any way. Author Editor Paper Paper_author ) paper_review Reviewer Sample Inputs Author Editor Paper paper_author p…
Is it possible to do a several calculations in partition by statement in SQL?
I want to do the following calculation in SQL Microsoft server, As I understand all variables are aggregated by partition by the statement, however, I got an error Incorrect syntax. How can I solve the problem? Data is following and the output should be as in output column Answer Each window function needs an…
How to query for the difference between the sequences of two columns, from differing tables
I need a query that will compare the sequences of two columns (from two different tables) and display the first differing result. Summary with details follow: Operating out of a PostgreSQL server and using DBeaver Two tables with identical column headers. One entry (creq_id) will have 36 sequences (seq). When…