Skip to content

Is there a flexible way to specify ranges of dates?

I am working with MySQL. I have some queries that begin like this: I also sometimes need to run the same query, but with each date range being a week (Monday to Sunday), or a calendar month. Moreover, sometimes there are 100 or more of these, which is quite prone to typos in addition to occupying a lot of lin…

Sql – Calculate Inventory Days

I’m trying to calculate inventory day’s over time. I have an issue getting the actual amount of day’s in inventory for the last month. So as for the first row, the 9 days is correct. However the second row should show 34. Since I want to calculate the days between Inv_date and “today&#…

SQLite Database not getting updated

So Ive created an app where the user can input details about the movies he has watched such as name,cast,rating…ect and the details are stored in a database inside a table names which is initialized in the DataBaseHelper class as in the below segment of code Ive created a list view and displayed the nam…

Select longest word from a string SQL

Let’s say that I have a table with 2 columns: name and number. Name is a string which can have one or more words and I would like a new query with select name number but that in the name column it only has the longest word of the original table. Is there a function in SQL that extracts from

SQL. Join with filter and offset

I need to create a SQL query that will return images with tags. The result should be ordered by some column and filtered by UserID and tags. The result should be paginated. There is a SQL statement This request is not working as expected. I expect to get 50 images, but they will be combined with tags and the …