I have a table, I want to get all the max values of col1, col2, col3 using one query only. I’m using sqlite and flask-sqlalchemy. I tried but then I got [(88,), (30,), (75,), (93,)] I want the output to be [(93,), (88,), (75,)] How can I do this? Answer I think you want three separate calls to MAX here:
REGEXP_REPLACE Strings Starting and Ending with Specific Substrings in Snowflake
I am trying to create a column in a view in Snowflake that replaces any string between strings that I care about with nothing. This is essentially for the purpose of stripping html formatting out of text. As an example: Would should end up like this: Based on the patterns I am seeing, I think that if I can el…
Similiar UPDATE instruction in PostgreSQL
Is there an example of a 2-columns table, (x, y – INTEGER), which given instructions: will show different results? Answer Sure:
How to find out which Foreign Keys to create / reference in existing tables in Snowflake?
We have a lot of tables in Snowflake, none had Primary Keys (I’ve just added them in) but now I’m feeling overwhelmed trying to figure out how to create Foreign Keys without going through each table to see the link between data in two tables? Is there a script that I can create to even do this? P.…
Get Start and End date from multiple rows of dates, excluding weekends
I’m trying figure out how to return Start Date and End date based on data like in the below table: Name Date From Date To A 2022-01-03 2022-01-03 A 2021-12-29 2021-12-31 A 2021-12-28 2021-12-28 A 2021-12-27 2021-12-27 A 2021-12-23 2021-12-24 A 2021-11-08 2021-11-09 The result I am after would show like …
Round up to the next whole number case it contains decimal point (In SQL Oracle)
I need to retrieve a field from a table and display the results rounded up to the next whole number if is not whole yet. For example: I have in my table the field working hours. I need to create de following logic. Else select as it is (4.0). Answer Is this what you want?
Wildcard for string before @ character
How would I use a wildcard to filter out any permutation of the following. There can be any number of zeros before the “@” character. Example Basically, I’m looking to wildcard any email address with only zeros before the @ character. Any help would be greatly appreciated Thank you ! Smiddy …
Replace missing value with similar row values in same dataset (no joins)
After completing necessary table joins I want to replace missing values in a column where the correct value exists in that same column already. My desired approach is “if you see this row’s same …
create an output column
I’m working on a customer level, and I have a column that contains the 3 types of products I’m selling, what I want is to know every customer what products they already purchased? but what if that …
Tricks to exceed column limitations in SQL Database
Hello swarm intelligence! I have the following use case: For every movie that is requested by a user, I create a number of tags for that specific movie, derived from several sources (actors, plot etc.. ). I will use this data for associaton mining. The problem: If I use the movie for rows and the tags for col…