Skip to content

Full text search for compound words

I am looking into PostgreSQL full text search and would like to know if it is possible to search for the second part of compound words. It there a way to get ‘Cheesecake’ as a result when I search for …

SQL Rows to column but NOT transpose

We have a table regarding identification where data is as such: Customer Number Identification 101 passport-us 101 Licence 102 passport-uk 102 Licence 102 birth-cert 103 Licence-learner Thus one customer may have submitted multiple identification others in varying number/combination. Result we are after is : …

SQLite – Select posts based on tags

I have two tables in my database: posts, which contains post id and other informations, and tags. In tags, there is a column post_id and a column tag. My idea is to store each tag in a separate row. For instance, a post with id 1 and tags foo, bar and eggs would be stored in tags as Which is

Extract nested data in JSON variable in SQL

I need some help extracting the data I need out of a JSON variable in SQL: I need to get management_account_id, Month and cost_to_client/details in a table, the problem I am facing is that the month is higher up on the hierarchy than the details section, so I’m going into each individual month to access…

Questions with Pivot SQL Server

Questions with Pivot SQL Server Good morning people I’m trying to pivot the table below with the sql server using the VALOR1 Column and ignoring the VALOR2 and VALOR3 column: Before After SqlQuery The problem is that I realized that in order to have one row per year, the VALOR2 and VALOR3 fields must be…

WordPress Find ID of a Post with a specific meta value

I have about 25,000 posts here (and rising). All of them under a Custom Post Type “lead”. Each post has meta information, including a variable called “uniqid”. this uniqid is a url parameter. now i need the post id where exactly this uniqid exists. Now my question is if there is a way …

Postgres – Select days with FAILURE status only

I have table with multiple result per days for particular project_name (SUCCESS, FAILURE, ABORTED, UNSTABLE). I would like to select only days where only FAILURE status occurs – nothing else. There are some days with multiple status (after FAILURE it can be solved and get status with different time and …