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 …
Need to lookup part data when there are multiple rows of the same part
I have a SQL Table that has parts with their own 2D barcodes. There may be multiple rows of the same part. Each row has a column with the Date_Time stamp. What I need is to get the latest part data and view one of the columns to see if that value is INT 1. Example below: Look up the
Joining two tables with same keys but different fields
I have two tables both all with the same fields Except for one. I want to combine these two tables with the resulting table having all the fields from both including the two fields that are not the same in each table. I.e: lets say I have table order_debit with schema and table order_credit with schema What I…
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 …
Oracle 12 – Reset a sequence Column with row_number() over Partition
I have this table (with order by product, seq): As you can see because of some delete statments I need to reset the seq column and have a seq from 1 for every product/group like this: I tried to create a new counter with this code: and the result was like this: But when I try it with Update I
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 …