skip to Main Content

MySQL – Calculating the total number of room sold exclude cancellation for each date in a particular date range of each category

I have booking sample data as follows: ----------------------------------------------------------------------------------- hotel_id | roomtype_id | status | booking_timestamp | checkin_date | checkout_date ----------------------------------------------------------------------------------- 1 | 1 | new | 2023-02-02 00:15:30 | 2023-02-03 | 2023-02-05 1 | 1 | new | 2023-02-04 09:10:15…

VIEW QUESTION

Postgresql – Split string using Regex in Postgres function

I need help splitting the string below using REGEXP_SPLIT_TO_ARRAY in a Postgres function: keyone="valone" key_two="val two" KEY_THREE=val three keyfour="http://sample.domain?par1=val1&par2=val2" keyFIVE=valfive and the resultant array should look like this: (keyone="valone",key_two="val two",KEY_THREE=val three,keyfour="http://sample.domain?par1=val1&par2=val2",keyFIVE=valfive) I ended up with this myarray := REGEXP_SPLIT_TO_ARRAY(mystring, E'\s(?=([^"]*"[^"]*")*[^"]*$)');…

VIEW QUESTION

Can you load data into a MySQL table while "counting" repeated values found in multiple columns combined into one?

sorry for the confusing title but I hope this explains my question. I have a tab delimited text file that looks like this if I were to display it as a table: ════════╤════════╤════════╤═════════╤═════════╤═════════╤═════════ item │ id │ info │ PERSON1…

VIEW QUESTION
Back To Top
Search