Quantcast
Channel: Substring In Sql | Automatic Website Traffic RSS
Browsing all 989 articles
Browse latest View live

Splitting CSV strings in SQL 2016

One using casts the string as XML and then parses the nodes to return a table and the other uses a very inefficient looping operation with charindex and substring. For performance reasons I’ve always...

View Article


Comparing SQL Server and MySQL Functions

You’ll be happy to know that the following functions are usable in both MySQL and SQL Server queries without any modifications: ASCII, LEFT, LOWER, LTRIM, REPLACE, REVERSE, RIGHT, RTRIM, SOUNDEX,...

View Article


TechTip: C# for RPGers: Not All Strings Are Born Equal

Substring is very similar to an RPG BIF ... His areas of expertise include programming in the IBM i native languages (RPG, CL, and DB2 SQL) and "modern" programming languages, such as C# and Python, as...

View Article

Pattern Matching : More Fun When I Was a #Kid

In one case, the person cited an article by David Lozinski, "SQL: LIKE vs SUBSTRING vs LEFT/RIGHT vs CHARINDEX." Yes, the article shows that, in the contrived example, CHARINDEX performed best....

View Article

Oracle SUBSTR Function Explained with Examples

The Oracle SUBSTR function is used to get a smaller string (the substring ... The only way that I know of to get a SUBSTR from a LONG variable is to write a PL/SQL procedure that takes a ROWID, then...

View Article


SQL and Data. Learning to Retrieve Data Efficiently and Accurately

Execute SQL*Plus Type describe billing_accounts Type desc orders Type SELECT???? FROM billing_accounts bact, orders ord WHERE bact.id = ord.bact_id AND substr(ord.name,1,3) = 715 AND bact.rentyp_id...

View Article

Optimizing SQL Server CPU Performance

For more information on SQL traces, see msdn2.microsoft.com/ms191006.aspx. SELECT substring(text,qs.statement_start_offset/2 ,(CASE WHEN qs.statement_end_offset = -1 THEN len(convert(nvarchar(max),...

View Article

Splitting CSV strings in SQL 2016

One using casts the string as XML and then parses the nodes to return a table and the other uses a very inefficient looping operation with charindex and substring. For performance reasons I’ve always...

View Article


T-SQL: RIGHT, LEFT, SUBSTRING and CHARINDEX Functions

This article explains the functionality and uses of the LEFT, RIGHT, SUBSTRING and CHARINDEX functions in SQL. This article will leave you with sound knowledge and understanding that you can take away...

View Article


Understanding your SQL Server Fragmentation

So, now the time to see WHY SQL Server can’t shrink our file ... Object_Name(@i) + ']' , CONVERT(GEOMETRY,'POLYGON(' + SUBSTRING( ( SELECT ',(' + CONVERT(VARCHAR, (page_id % @d) * 10) + ' ' +...

View Article

DB2 for z/os Migration: Query Performance Considerations

HEX(SUBSTR(IBM_SERVICE_DATA,9,4)) AS SORT_POOL_SIZE FROM PLAN_TABLE WHERE QUERYNO=6475 *NOTE 1: CPU count is only populated if query chooses parallelism **NOTE2: Search Modeling a production...

View Article

SQL - String Functions

SQL> UPDATE table_test -> SET blob_col=LOAD_FILE('/tmp/picture') -> WHERE id=1; ..... The first syntax returns the position of the first occurrence of substring substr in string str. The...

View Article

Comparing SQL Server and MySQL Functions

You’ll be happy to know that the following functions are usable in both MySQL and SQL Server queries without any modifications: ASCII, LEFT, LOWER, LTRIM, REPLACE, REVERSE, RIGHT, RTRIM, SOUNDEX,...

View Article


Top 80 + SQL Query Interview Questions and Answers with Examples

Oracle Equivalent of SQL Server SUBSTRING is SUBSTR, Query : select substr(FIRST_NAME,0,3) from employee SQL Server Equivalent of Oracle SUBSTR is SUBSTRING, Query : select substring(FIRST_NAME,1,3)...

View Article

Understanding your SQL Server Fragmentation

So, now the time to see WHY SQL Server can’t shrink our file ... Object_Name(@i) + ']' , CONVERT(GEOMETRY,'POLYGON(' + SUBSTRING( ( SELECT ',(' + CONVERT(VARCHAR, (page_id % @d) * 10) + ' ' +...

View Article


Splitting CSV strings in SQL 2016

One using casts the string as XML and then parses the nodes to return a table and the other uses a very inefficient looping operation with charindex and substring. For performance reasons I’ve always...

View Article

Use PowerShell to Determine the number DML operations in SQL Server Scripts

We can use one of my favorite libraries to do this easily - .NET's very fast StreamReader, for reading a SQL file. Likewise, since PowerShell uses .NET, this library includes many useful built in...

View Article


Oracle SUBSTR Function Explained with Examples

The Oracle SUBSTR function is used to get a smaller string (the substring ... The only way that I know of to get a SUBSTR from a LONG variable is to write a PL/SQL procedure that takes a ROWID, then...

View Article

Pattern Matching : More Fun When I Was a #Kid

In one case, the person cited an article by David Lozinski, "SQL: LIKE vs SUBSTRING vs LEFT/RIGHT vs CHARINDEX." Yes, the article shows that, in the contrived example, CHARINDEX performed best....

View Article

SQL - String Functions

SQL> UPDATE table_test -> SET blob_col=LOAD_FILE('/tmp/picture') -> WHERE id=1; ..... The first syntax returns the position of the first occurrence of substring substr in string str. The...

View Article
Browsing all 989 articles
Browse latest View live