using sql server: I have a number of commands that trim a txt file, example: Case when charindex(‘-‘, Substring([RawStreamOut], 179, 10)) > 0 then ‘-‘ + Replace(LTrim(RTRIM(…
Tag: substr
How to retrieve the last part (i.e. a number varies in length) of a text column of which’s length varies in Oracle and store this in another column?
I am trying to get the last number from a Oracle SQL column called Description and store it in another column called Thickness. As you see, the length of the description varies as well as the length of the number at the very end. It is sometimes a double such as 1.5, sometimes an integer like 3. I have tried
Oracle SQL Join an ID on a field with a list of IDs some with ranges
First of all, its not my database and I cannot change it:) This is an oracle database I have a table with 2 ID fields code and subcode: Table1 ID Code Subcode 1 300 010 2 400 050 3 300 060 I …
DB2 z/OS – Get the last 2 digits of year
SELECT SUBSTR(CAST(YEAR(SOMEDATE) AS VARCHAR(4)),2,2) AS “YY” FROM SOMESCHEMA.FOO; Gets me the following error: [Code: -104, SQL State: 42601] ILLEGAL SYMBOL “,2”. SOME …
How to select sub string in oracle?
I have a scenario where my data is something like below: Chapter 18 Unit 10 Sect 16 Case 1 : I want to select Chapter 18 from the above string. Case 2 : I want to select Unit 10 from the above …
Query to get all those names of employees,who have ‘A’ as their middle character in their name
E.g:- BRAKE,CRANE etc. In my employees table , I have ENAME,ENO,JOB,SALARY. Here, I want to extract out those enames that have an ‘A’ as the center character in their name. If length of ename is …