i am executing SQL statement like this with PDO. and $_POSTData_array is like this the problem is i can’t get the null as null in db, its update as blank. any help??? UPDATE ! as per comment by Álvaro González i tried var_dump(). var_dump() is much better. I need to insist: how do you know that you̵…
Tag: sql
How to modify result of select statement based on values?
I am not MySQL guy just learning by doing things, I have database that stores value 0 or 1, now in grafana I want to display online if value yield from select statement is 1 and offline if value of online in select statement is 0. So far this is what I wrote But select statement through error. Answer You̵…
How to have exact decimal values without rounding in MySQL
I have this SQL script below: What I expect like result is: 72.39. I don’t want to round the number. if I use the select round(72.396, 2) the result I get is: 72,40 How can I have what I expect without rounding using Mysql? Answer You need to use the truncate function instead of round: To answer the que…
MySQL 5: How to find the peak of customers during working time
I have table in MySQL with times spent by customers and I need to find the most busy 30 mins. Expected result is something like multiplerows with time and number of customers: I can easily make 5 sql queries and get the result (I made some view in similar problem https://stackoverflow.com/a/59478411/11078894 …
Managing multiple categories trees, using Python and PostgreSQL
I have multiple categories, which can have None or one or multiple sub-categories. The process theoretically can go to infinite. So, it is like having multiple trees. Tree example. I have also Item(s). An Item can be in multiple categories. At this moment to connect the categories, in database I use three fie…
SQL query to find largest id for each user_id
I am currently querying from 4 different tables, users, memberships_users, membership_levels, phone_area_code From the users table, I would like to select id user_login, user_email, display_name …
String Split String With multiple columns same separator
I have the following string ’06/30/2020;58044.373;.001;12/31/2020;58042.373;.003;06/30/2021;78044.373;.007′ I need to transform it into : col 1 col 2 col 3 —- —– –…
SQL Server : Stored Procedure for Preventing Duplicated Values
I have this code which I have created which I want to stop any duplicated values from being inserted into the database, however the values still continue to be able to get into the IF_Translations …
Whats the disadvantage of setting a too high batch size?
I set the batch_size in application.yml: spring: profiles: dev jpa: properties: hibernate: generate_statistics: true jdbc: batch_size: 20 Whats the reason …
Find by multiple columns and rows criteria sql query
I have Paths and Criteria tables in PostgreSQL. Paths have multiple criteria that should be fulfilled to be selected. Path table with (id, name), Criteria table with (id, key, value, path_id) I …