Table 1 has error messages with a variable number of numbered placeholders within squiggly brackets. I need to build the completed messsage with values from a 2nd table. Table 1: Table 2 The relationship between the tables is, of course, the error_id and placeholder/arg_seq_nbr values. A correct result would …
Tag: sql
Group by one column and return several columns on multiple conditions – T-SQL
I have two tables which I can generate with SELECT statements (joining multiple tables) as follows: Table 1: ID Site type time 1 Dallas 2 01-01-2021 2 Denver 1 02-01-2021 3 Chicago 1 03-01-2021 4 Chicago 2 29-11-2020 5 Denver 1 28-02-2020 6 Toronto 2 11-05-2019 Table 2: ID Site collected deposited 1 Denver NU…
Strange Query Plan for SQL Query – Clustered Index Seek
I’ve got a really strange issue with a Query plan generated for a very simple SQL query. The query is searching a full text index, and returning the count of records. For some reason, this SQL query is producing a Non Clustered Scan on an index, which I don’t believe it is optimal to do. I believe…
Oracle : Select only particular value from a row
I have a like below data : so i wanted to remove all the value after = and before | except for 1234. expected data : Answer You can use: Which, for the sample data: Outputs: VALUE 1234=A||1456=||1789= 1245=||1234=V 1234,1133 1456=||1234=1,234||1234 sqlfiddle here
Check value if exist in another table within Select Query
I have three tables first table stores user basic Info, the second table stores that user who exist in LDAP directory and third table store common information of both tables. below is the table structure I want name from a table if the value is not matched then check to another table. the desired output looks…
How can I translate this legacy SQL to standard SQL in BigQuery?
I need to translate this to BigQuery. Can anyone help? Thanks This is the error I’m getting. The Google BigQuery Standard SQL database encountered an error while running this query. Query execution failed: – Syntax error: Expected “(” but got identifier “DATEDIFF” at [2:25]…
SQL Query to determine number of tables
I have this table and I’m trying to determine how many Tables (in a restaurant) are awaiting food. The table( in the database) has the following columns: TableNumber, ObjectType, ObjectDescription and Quantity (amongst others). I made this query to see what is ordered, but would like to know how many un…
XMLTable query returns no result
I’m only passingly familiar with XML. I need to parse a response from a SOAP request. From a lot of searching, I’ve developed the following query to try to extract the status. Ultimately, I’d like to get the status, cntr and cntr_status fields from the response. My query gives no error, but …
match against doesn’t work with the word “when”
When desc contains the string: zoom when wifi dies for 1 second Query 1: No problem, I get the row! Query 2: No results! So when belongs to sql commands. So how to solve this? Answer You need to learn some basics about full text search. One very important concept are stop words. These are words that are not i…
Postgresql – Using CASE and PARTITION BY clause to create effective and thrudates
I’m new to PostgreSQL. I have been working with SQL Server, so I have limited experience with PostgreSQL. I’m trying to convert some SQL Server queries for PostgreSQL and ran into the following issue. Suppose I have the following table key date value A 2000-01-01 1 A 2001-01-01 2 A 2002-01-01 3 B …