I have a select query, that selects over 50k records from MySQL 5.5 database at once, and this amount is expected to grow. The query contains multiple subquery which is taking over 120s to execute. …
Tag: mysql
How to select titles that are like the first n characters of a string?
Here’s an example There are titles of some animes: And I’d like to select those titles, that contain the first 10 character of the first record, so “My Hero Academia” in this example It’s important that it must be the first N characters, like 10,15,20. So SELECT title FROM tablen…
SQL: Selecting all tuples which contain a certain value in a column after using count
I have the following table called Stores: Name | Category | Industry ABC appliances retail XYZ banking finance NZE clothing retail JKI …
Let SQL throw error then handle or prevent error completely?
In my code I generate a list of IDs then input associated data into a table with ID as the Primary Key. Is it better practice to let SQLSever throw an error and handle it (Integrity Error)? Or should …
How to get repeatable partition as new one after another partition?
“Partition by” in OVER clause groups all of the values as unique, just like “Distinct” or “Group by” do. This is how it works in my query with row_number(): id st t row_number ————–…
SQL- query which finds the name of a specific row which has max linked columns from another table
There are 2 tables: users: id, name albums: id, user_id I need a SQL query which finds the NAME of the user who has the max count of albums. How do I do that? Here is what I have tried so …
Round Up Decimal Values in SSRS Report
I cannot get to round up or fix the value of my outcome to Two or one decimal places in Report Builder. I am using Code in my Report Builder Expression: =SUM(Fields!COMPLETE.Value)/SUM(Fields!Total….
MySQL select a certain amout of rows for each type in a certain c
I would like to select the first certain number of rows, by groups of a certain column. For example : Original data: index type value 0 1 a 0.716430 1 2 a 0.223650 2 …
MySQL Query Text Across Multiple Tables
I have two MySQL Tables; City and Country, I want to allow a user to search across the two tables for something which matches in either, and I want a quality match/relevancy order from both tables. (…
Mysql query for comparing price one to each other based on type
example table name | source_data | price_a | ——————————— name A | site_a | 40.00 | name A | site_b | 50.00 | name B | site_a | 30.00 | name B | site_b …