Skip to content

Split string value and use in INSERT and UPDATE command

I Implemented a small ERP system for our kitchen. The system is used to track our groceries, so it contains the goods (referred as food) with its name and UPC code. Over the time the names and upcs started to overlap and creating a data problem. In a first attempt we started to add the manufacturer into the n…

Ignore SQL INNER JOIN if specific record exist?

i got two table joined like this I want to display results of two table joined but with condition if the status of TableB has anything in (‘CO’,’CL’) the whole join with id of TableA would be ignored not just the rows with status not in (‘CO’,’CL’). A.id and A.T…

Pivoting a string from a table function in different columns

I have a task to create a table function that receives a string and sorts it into different columns. The string itself may vary, but the columns are supposed to be the same always. The string is: ‘100^TEst¬200^TEst2¬300^Test3’, but for example if I add “¬400^Test4” that should be in th…

MySQL-condition on partition size

table1 has 3 columns in my database: id, category, timestamp. I need to query the newest 3 rows from each category: now I need to add one more condition: select only from the partitions which have at least 3 rows. how to add this condition? Answer here is another way: