I am trying to develop an R Shiny app with an SQLite Database. But I am facing this error while getting any data from the database. The error message is: Loading required package: shiny Attaching …
Tag: sql
I’m looking for a pair of SQL functions (MS SQL Server) that will return the MAX or MIN of a list of dates
I’m looking for a pair of SQL functions that will return the MAX and MIN value of a list of dates (or, alternatively, the MAX and MIN of two dates – I can then stack the calls to handle the whole list)…
Delete a task stored in SQL database through html form using Python
This is a web app written in Python to add and delete tasks. This is the add_tasks function: @app.route(“/add”, methods=[“GET”, “POST”]) @login_required def add(): …
PostgreSQL: sum of days in range
I have a table as follows: Table “public.fish_schedule” Column | Type | Collation | Nullable | Default ——–+————————+———–+—…
Data aggregation by sliding time periods
[Query and question edited and fixed thanks to comments from @Gordon Linoff and @shawnt00] I recently inherited a SQL query that calculates the number of some events in time windows of 30 days from a log database. It uses a CTE (Common Table Expression) to generate the 30 days ranges since ‘2019-01-01&#…
SQL: create global alias for nested SELECT to be used in another nested SELECT
Let’s assume I’ve got a database with two tables: people which contains person’s id and his/her birth year for each person and parents which contains the (parent_id, child_id) pairs to represent the relative relationships between people. To make the explanation easier let’s assume each…
SQL Server Database Error Conversion failed when converting the nvarchar value ‘ ‘ to data type int
I am running this in TOAD. Please forgive my ignorance, I am new to SQL. it ran once and gave me all of the data I was looking for but now when I execute this query, I keep getting Database Error ‘SQL Server Database Error Conversion failed when converting the nvarchar value ‘ ‘ to data type…
SQL Query for max value from subsets
I have a table bls_jobs with the following columns: city, state, occ_title, jobs_1000, and loc_quotient I am trying to retrieve the highest loc_quotient for each city (each city has several occ_titles, and each occ_title has a loc_quotient) Currently, I can use this query: Which does return what I’m loo…
WHERE clause is not filtering all specifications
I’m trying to make a query with different specifications in WHERE clause and some of them are being ignored. SELECT DISTINCT f.NameLawyer AS ‘Comisiona’, f.Bill As ‘Factura’, f.Amount AS ‘…
Merge tables in R and update rows where dates overlap
I hope this makes sense – it’s my first post here so I’m sorry if the question is badly formed. I have tables OldData and NewData: I need merge these tables as below. Where IDs match, dates overlap, and Priority is higher in NewData, I need to update the dates in OldData to reflect NewData. …