Skip to content

Tag: sql

sql query to count and display full name

So I am very confused by this query to display teachers’ full name. I have used teacher_name ||’ ‘|| teacher_lastname, but when I try to do so for the students, something happens. I am trying to get …

SQL to Get Latest Field Value

I’m trying to write an SQL query (SQL Server) that returns the latest value of a field from a history table. The table structure is basically as below: ISSUE TABLE: CHANGEGROUP TABLE: CHANGEITEM TABLE: EXPECTED RESULT: So each change to an issue item creates 1 change group record with the date the chang…

Split and compare two Strings in Oracle SQL

I have a table with three columns structured as followed: Now I would like to perform an Oracle-SQL-query which gives me the edit-pattern of the two strings left and right. The result should be as followed: Al my tries with REGEX_SPLIT and CONNECT BY were not successful. Do you have any ideas how to solve tha…

Oracle Select max where a certain key is matched

i’m working with oracle, plSql, i need to query a table and select the max id where a key is matched, now i have this query It’s displaying this data If i remove the ID from the query, it displays the distinct keys (in the query i use the alias KIES because keys was in blue, so i thought it