Skip to content
Advertisement

Tag: string

Word unscrambler in MySQL

Let’s say I have the input string “Hello” I want to be able to retrieve these output words: hole, lol, eh, hell All the output words letters should be contained in the input string. How I should be able to achieve that? I’ve tried to use like: But this returns words such as: hi، loop,etc.. but I need the all

Find Multiple Substring from a String Using SQL

I have a column log. I need to extract values from that log column and make 4 new columns My table: Output I need: Answer If the string really always follows exactly that format, you can use something funky like this: Which gives: This abuses the PARSENAME function, which is meant to parse 4 part named objects (server_name.database_name.schema_name.object_name).

How to escape it properly?

I have sql string written with template string syntax: I have problems with binding second param – $2 because of single quote. How should I write it properly ? Error: Error: Query failed: bind message supplies 2 parameters, but prepared statement “” requires 1 Answer I think you’re supposed to use wildcards this way:

how to use wildcard for a column jsonb type

I have a table (named profile) in my Postgres database, which has 3 columns: ID, Day, Ftfm_profile of type jsonb, I tried to extract the row where the profile name (ftfm_profile->’name’) begins with ‘LFBB’ ( sql: LFBB%) using the wildcard as following: the expected result: I can’t seem to find the solution, thanks for your help Answer One option unnests

Advertisement