About 59,400 results
Open links in new tab
  1. sql - Can we use a CASE...WHEN inside SUBSTRING? - Stack Overflow

    May 29, 2014 · I asked a previous question with an input->output but the answers weren't in the format I was asking for (the CASE..WHEN inside a substring). Here's a more generalized form …

  2. SELECT Statement with substr in WHERE Clause - Stack Overflow

    Mar 9, 2012 · To get the fields (FieldB, FieldC), I need the correct values of paramA = '123' and paramB = '456' so it will return XYZ and John. If I want to return James then i have to give …

  3. sql - How to join two tables based on substring values of fields ...

    Feb 21, 2015 · 3 The character position is wrong. You should start your substring on the position 2 (the first character of your string is 1 and not 0). On the other side, you are using the …

  4. trim left characters in sql server? - Stack Overflow

    Jan 11, 2011 · I want to write a sql statement to trim a string 'Hello' from the string "Hello World'. Please suggest.

  5. SUBSTR and INSTR SQL Oracle - Stack Overflow

    I've started using SUBSTR and INSTR in Oracle but I got confused when I came across this. SELECT PHONE, SUBSTR(PHONE, 1, INSTR(PHONE, '-') -1) FROM DIRECTORY; So I …

  6. How to Select a substring in Oracle SQL up to a specific character?

    In Oracle you can create functions (standalone or in a package) and use them in a select statement.

  7. how to use like and substring in where clause in sql

    7 You can concatenate strings to form your LIKE string. To trim the first 3 and last 3 characters from a string use the SUBSTRING and LEN functions. The following example assumes your …

  8. How to use SQL CONCAT/SUBSTR? - Stack Overflow

    Feb 18, 2015 · 4 You seem to be confusing the concat function, substr function and the concatentation operator (||). You aren't using substr to get the first character of the first name, …

  9. How do I only return part of a string with varying lengths in SQL?

    Sep 17, 2014 · In SQL Server, use a combination of PATINDEX, CHARINDEX and SUBSTRING to parse the address from the string in each row. The cursor lets you loop through your table.

  10. Get everything after and before certain character in SQL Server

    Jun 13, 2012 · 81 If you want to get this out of your table using SQL, take a look at the following functions that will help you: SUBSTRING and CHARINDEX. You can use those to trim your …