Postgresql – Split and sum in some cases
I need you infinite knowledge. I have some kind of data in a column (text) state 0 0,0 13 13,27,0 0,0,0 Is a text column, but it can have a number, or many numbers separate by commas (not defined how…
I need you infinite knowledge. I have some kind of data in a column (text) state 0 0,0 13 13,27,0 0,0,0 Is a text column, but it can have a number, or many numbers separate by commas (not defined how…
I have the following two tables: CREATE TABLE `ip_info` ( `start_ip` int(10) unsigned NOT NULL, `end_ip` int(10) unsigned NOT NULL, `country_code` varchar(3) DEFAULT NULL, `country_name` varchar(255) DEFAULT NULL, `continent_code` varchar(3) DEFAULT NULL, `continent_name` varchar(255) DEFAULT NULL, `asn` int(10) unsigned DEFAULT…
I am restoring a copy of my wordpress site so I went into phpMyAdmin and clicked import and then import my SQL file. After a minute or so of loading I get a notification: "MySQL said: #1071 - Specified key…
There's a table with compound index (col1, col2, col3). There's a lot of data in this table. Want to build query for example WHERE col1 = 2 AND col2 = 12 AND col3 IN (1, 2, 3, ..., 40) Is…
I am trying to write a SQL, with a scenario: If I have 3 years in my database- 2022,2023,2024. If the current month is anywhere between March 2023 to Feb 2024, it should return the year 2023 only. If the…
I have a table in MySql database with thousands of records. The structure is as below Here the column "difficulty" has three possible values, which are A, B, and C. Question is I need to retrieve 10 random rows from…
I Want to select transactions under PL Category 52105 and transaction codes 9007 & 9803, but the results are are picking other transaction codes other than those 2. Where am I getting it wrong? FROM [Steward].[dbo].[vwNONFUNDED_RECOMP_04] WHERE PL_CATEGORY_CATEG_STMT IN ('52105')…
I have a table with two columns: the action start time and the name of action. time action 2023-07-27 04:52:00.000 running 2023-07-27 04:55:00.000 walking 2023-07-27 04:59:00.000 walking 2023-07-27 05:01:00.000 sitting 2023-07-27 05:06:00.000 walking 2023-07-27 05:10:00.000 running I need to know…
Table students has 3 columns id, name, and class. I want to select the matched row based on the condition for example if the student's name is Jhon, plus the next 3 rows (without any condition) followed by the match…
Error on input data after creating postgres partition SQL Error [23514]: ERROR: No partition for relation "data_part" for that row Detail: Partition key value of failed row: (ymd) = (20190902) thank you!! === sql === CREATE TABLE data_part ( ymd…