Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
-7 votes
0 answers
51 views

Problem while writing code using the Head First Python 2e book. I can't log in with my own ID [closed]

I followed the author of the book mentioned in the title step by step. I created a database vsearchlogDB and wrote: grant all on vsearchlogDB.* to 'vsearch' identified by 'vsearchpasswd'; and exited. ...
Matviy Vorotilin's user avatar
-1 votes
0 answers
53 views

Complex query with column transformation [closed]

I want to get data from my database with as few queries as possible to not waste time with network latency, which is affecting overall performance significantly. This is a simpler version of my ...
Rapwnzel's user avatar
  • 270
0 votes
2 answers
51 views

GROUP_CONCAT in LEFT JOIN subquery is very slow

I've have a query which is performing poorly and I'm not sure where the problem is. A massively reduced version of the query, which still shows the same problem is: SELECT members.id, FROM members ...
Dom's user avatar
  • 3,111
2 votes
1 answer
54 views

After Collation change not being able to update values (MariaDB and MySQL)

I tried to update my tables collation from utf8mb4_general_ci to utf8mb4_unicode_ci, which is pretty simple specially using pmpMyAdmin. But after several attempts to update values it seems that ...
user2653774's user avatar
4 votes
2 answers
114 views

How to find out exact return type of the RANK() window function in MySQL and MariaDB?

I am accessing a MySQL and MariaDB database using Rust with SeaORM, and my query includes the RANK() window function. In MySQL, I can fetch the rank column value using u32 (unsigned integer), In ...
Alok's user avatar
  • 10.8k
1 vote
1 answer
80 views

Sql select query where records match max value for a column less a given offset?

I have a table Test... Time Location 10 A 1 B 2 C 3 D 4 E And I want to return all records between max value of Time and a given negative offset of max Time, ...
Dachshund Digital's user avatar
0 votes
4 answers
62 views

Is there a way to sort based on average of multiple columns, ignoring NULL?

I have a table that I want to sort based on the average of 3 columns. For example: select * from table order by ((col1+col2+col3)/3); HOWEVER, if any of the three columns are null, then the null ...
S.ov's user avatar
  • 410
0 votes
2 answers
88 views

Dynamic dialog radiolist from MySQL or MariaDB query?

This works to create a name-picker radiolist dialog box: dialog --stdout --no-tags --clear --backtitle "Name Picker" --title " Name Selection " --radiolist " Select the name &...
Howard Rogers's user avatar
1 vote
3 answers
82 views

Calculate daily, monthly, and yearly outstanding in MySQL by receipt_id, considering paid_amount only once per receipt_id

I'm working with the following table structure in MySQL: SELECT sale_id, unit_id, quantity_sold, total_price, bought_price, paid_amount, tax_percentage, sold_by, ...
humans9198's user avatar
0 votes
2 answers
41 views

Query using maximun date with its corresponding info

The following customer table is given: customerNumber expireDate versionNumber 111 2021-02-08 10:00:00 2 111 2022-02-08 10:00:00 2 111 2022-...
user3637971's user avatar
2 votes
1 answer
104 views

Using Entity Framework method ExecuteUpdate: Set current property value to another property

With the code fragment below, I would like to update the status properties of multiple database records, for example bookings. Each record has the properties StatusCurrent and StatusBefore. I would ...
Armand's user avatar
  • 21
2 votes
5 answers
149 views

MySQL Query to Get Last Occurrence of Same Weekday in Current or Next Quarter

Problem Description: I need a MySQL query that, given a date (e.g., '2025-02-10'), returns the last occurrence of the same weekday in the current quarter. However, if the given date has already passed ...
rMafia's user avatar
  • 75
0 votes
1 answer
50 views

mysql_fetch_field_direct does not return type of data anymore since updating server from mariadb 10.5 to 11.6

i am using this C++ code since long time without problems: MYSQL_ROW row = mysql_fetch_row(m_hRes); for(UINT nIndex = 0; nIndex < nFieldsCount; nIndex++) { MYSQL_FIELD* fls = ...
Timm's user avatar
  • 51
0 votes
0 answers
58 views

Making sure the SQL engine will prune away query parts that can be trivially rejected/never evaluated [duplicate]

In PHP, using MariaDB (and sometimes MySQL), I often need to insert query parts conditionally based on, eg., a condition expression in PHP: $somecondition = "1"; $statement = $pdo-&...
andynewman's user avatar
0 votes
3 answers
63 views

Can you help me speed up the selection when searching by square with latitude and longitude?

There is a request like this: SELECT * FROM `pet` WHERE (`unite_id` IS NULL) AND ((`status`=1) OR ((`status`=4) AND (`delete_reason` IN (1, 2, 5)))) AND ((`pet`.`latitude` BETWEEN '55....
pet karp's user avatar

15 30 50 per page
1
2 3 4 5
515