I found usefull JS function that I want to implement into snowflake’s UDF in order to move complex computation to the dwh. http://trentrichardson.com/2010/04/06/compute-linear-regressions-in-javascript/ Attempt to rework above as SQL procedure: Execution fails with error: SQL compilation error: Invalid identifier which is odd since procedure has been created. Answer You’re almost there. To pass an array, try using ARRAY_CONSTRUCT or PARSE_JSON,
Tag: database
Taking same column but different values from database in C#
I am trying to get top 3 safety data row according to equipment and plant selection from database. Now I could get top 3 safety value from database with equipment and plant selection and insert to textbox. When I wrote “‘ or Safety ‘” + textbox.text + it is getting other plant and equipment selections Answer Keep your sql been
Query table with compound primary keys
I’m using pyodbc to connect to a machine database, and query a number of tables in that database using pandas.read_sql(tbl,cnxn), where tbl = “SELECT * FROM TABLE”, cnxn is pyodbc.connect(‘DSN=DATASOURCE;UID=USERID;PWD=PASSWORD’). It works on most tables, but some tables return: DatabaseError: Execution failed on sql ‘SELECT * FROM TABLE’: (’42S02′, ‘[42S02] [Microsoft][ODBC driver for Oracle][Oracle]ORA-00942: table or view does not exist
Trouble with outer join coupled with search coupled with group by
I am trying to do 2 things with a query. 1) Return the ticket subject from one table and the matching messages from another table. This is a one to many relationship and I want the return to show the subject with all the messages for each subject concatenated. 2) be able to search against the subject as well as
How the db model should be for this scenario? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I’m modeling a database scenario but I’m not understanding properly how to achieve that. The scenario is a user that can
How to get student attendance_status by date using sql query?
In my database I have this data. Now I want to query and fetch data based on date and group by roll_number. I am able to fetch all the data using But I am not able to find what I want. I am learning databases and SQL. I used group by option like below but my result is not what
MySQL Group by with named columns from grouped data
I’m writing an application to record 10 pin bowling game results. I’ve done the submission bit but I’m stuck on displaying the results. Here is the structure: In the example above I am assuming each person played 3 games, however any number of games could be played. How can I get the data in a more friendly format? For example:
Postgres Counts based on Month and Years
I have a psql table I want to get a break down of users points that shows their points the current month, current year, and the lifetime. I’m a bit lost on how to do this. What would the query look like? The final table should look like this Answer How about conditional aggregation?
What is the equivalent of a collection and a document of firebase in sql?
My question is that what is the equivalent of a collection and a document of firebase in other databases like SQL or MongoDB, I know that there is a table in SQL but what is the equivalent of the …
How to merge columns and transpose in SQL?
I’m working with a custom DBMS (compliant with SQL 2011 Standard), and am trying to combine multiple columns into a single column like so, but am struggling with the syntax: Current table: Desired query output: I’ve tried various IF and CASE statements, but have hit a wall. Any help would be appreciated. Answer You can unpivot with union all: This