Column1 Column2 ——- ——- apple juice water melon banana red berry I have a table which has two columns. Column1 has a group of words and Column2 …
Tag: string
Multiple strings in one SQL field
I am trying to revamp an order system for an e-commerce web site. The header table for the orders is tbl_orders, that’s working fine but there is another table underneath that (so to speak) called tbl_orderitems In this table tbl_orderitems I store an Id that refers to the items image but sometimes ther…
How can I append a string to an existing field in MySQL?
I want to update the code on all my record to what they currently are plus _standard any ideas? So for example if the codes are apple_1 and apple_2 I need them to be apple_1_standard and apple_2_standard Before: Psuedo Query: Expected result: Answer You need to use the CONCAT() function in MySQL for string co…
What’s the R equivalent of SQL’s LIKE ‘description%’ statement?
Not sure how else to ask this but, I want to search for a term within several string elements. Here’s what my code looks like (but wrong): des is a vector that stores strings such as “Swinging Strike”, “In play (run(s))”, “In play (out(s) recorded)” and etc. What I wa…
MySql – Way to update portion of a string?
I’m looking for a way to update just a portion of a string via MySQL query. For example, if I have 10 records all containing ‘string’ as part of the field value (i.e., ‘something/string’, ‘…
Can MySQL replace multiple characters?
I’m trying to replace a bunch of characters in a MySQL field. I know the REPLACE function but that only replaces one string at a time. I can’t see any appropriate functions in the manual. Can I replace or delete multiple strings at once? For example I need to replace spaces with dashes and remove …
How to use GROUP BY to concatenate strings in MySQL?
Basically the question is how to get from this: foo_id foo_name 1 A 1 B 2 C to this: foo_id foo_name 1 A B 2 C Answer https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_group-concat From the link above, GROUP_CONCAT: This function returns a string result with the concatenated non-NULL v…