About 122,000 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 of my …

  2. How do I use SUBSTRING and CHARINDEX in SQL to return only the …

    Jan 2, 2020 · 0 I have a column of data that contains varchar data and I've been trying to return only the section contained with brackets using CHARINDEX and SUBSTRING : column data: 'this is an …

  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 SUBSTR function on …

  4. sql server - Right Substring Statement SQL - Stack Overflow

    SELECT SUBSTRING('123456789',7,2) The 7 is the position where you start, and the 2 is the length of the string that you want to retrieve. EDIT If you want SUBSTRING starting from the right (according …

  5. 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.

  6. sql - query for substring formation - Stack Overflow

    Jul 10, 2010 · Why this took them so long, I don't know. The crux of your need is to obtain a substring of the existing column value, so you need to know what the database substring function (s) are called. …

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

    Jun 13, 2012 · 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 entries. A possible …

  8. 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.

  9. 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, and to restirct the …

  10. sql - How to use Substring in left outer join - Stack Overflow

    Dec 17, 2021 · I tried to join these 2 tables with ALTERNATE_ID's using substring in left outer join but it doesn't work. Can someone suggest me how to do it. Here Table1 is master table, SELECT …