I have an SQLite table called wcvp constructed from a csv file downloaded from the World Check List of Vascular Plants (see https://wcvp.science.kew.org/ and http://sftp.kew.org/pub/data-repositories/WCVP/). When I run this query: I get this result: kew_id genus species infraspecies 304293-2 Quercus robur 771…
Single table or multiples tables (multiple company database)
I have to create a database for multiple companies, I have 2 options A single products table, with a company_id field to differentiate One table per company products_company1 products_company2 products_company3 Important: Data stored of each client will be updated every 1 hour Each company has 2000 – 30…
Stuck on getting deps through a query
I have a table, called refs, which has columns such as: depname, refname, reftype. Where, refname is the name of the table dependent on a view. For this use case, I want to get all the views directly or indirectly dependent on table(s) containing ‘sapphire’ in their name. I’m not sure how to…
spring batch table size limit
I am currently trying to read a table with about 5 million records using spring batch. After several minutes I got the follwing exception: org.springframework.batch.item.ItemStreamException: I am using a simple query: select * from table When using a query with a limit like select * from table limit 10000 it …
Most elegant way to search for a json value and replace it in mysql? [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I have a table called Entity which stores a bunch of jsons. The Json is bas…
SQL SUM values by DISTINCT column after JOIN
I’ve been searching the forums for a solution for hours now but I couldn’t quite find the one that is fitting for my problem. I have two tables: members **************** id name city 1 John Boston 2 Maria Boston 3 Steve London 4 Oscar London 5 Ben Singapore donations ******************** member_id…
Need to handle custom query summation for group
I have this table name “TB1” contain of these columns : I need a group with Bill.NO with sum column qty ,price from “TB1” to be like this : What I tried to do , I wrote this query but not doing as I want : Answer Really, you should leave these kind of things to the presentation layer. …
In SQL, how do I coalesce the first value of 3 columns that is 10 characters long
I am trying to only select one column from 3 distinct phone number columns, and I would prefer to have the column with the longest phone number (some don’t have area codes). Currently, I have coalesced the 3 columns as some are also null, with a preference on cell phone. Ex. What I’ve tried : I wo…
phpmyadmin how can i create a event like this?
I am creating an event on one of my databases to check if the client changed a specific parameter called ‘serverlog’ which is a boolean on my Sql database. Is there a way to loop through all the users in a table called ‘users’, check if ‘serverlog’ is false and update/set a…
How to find the average time? SQL Server 2017
I have a request like this: I need to find the average time for each status. For example, add up the time of all statuses 2 and divide by their number. As a result, get something like 2 days 5 hours. How to fix my request to make belt operations possible? Answer Taking your limited example data, something lik…