Skip to content

SQL, like, after characters

It’s possible to do a LIKE SQL after some characters? I wanted “LIKE” sql after “:” with ” A” So, REGEX like should be return only the first and third sentence. For the fourth sentence, i added ” ANSWER” should not itself return because the regex is &#8221…

SQL Left Join after UNION, error in your SQL syntax [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 months ago. Improve this question This…

Query to get the latest treatment for each machine

Let me just start by saying that I don’t care on which type of SQL I get an answer on. In reality I am creating my question in Kusto but the Kusto thread in stackoverflow is dead most of the time. This is just to give me an idea of on which way I could do this so I can

Multiple conditions in CASE WHEN statement

I’m working in SQL (Amazon Redshift) with Recruitment data where each applicant has multiple sources, which I’ve split into different columns called source_1, source_2, and source_3, along with a number_of_sources column to record how many sources that applicant has. We want each applicant to only…

Update table to make primary key out of two foreign keys

Have a table sample_tag which already exists with 1000’s of entries. It consists of two foreign keys, sample_id and tag_id. However, the database is allowing duplicate sample_id/tag_id records to be created. Without creating a new table, is there a SQL statement to update the sample_tag table such that …