Split 8s

Posted on by admin

Most of the time, even if you ARE counting cards, you still always split aces and 8s. But there are exceptions if you’re counting cards. If your count is negative and the dealer has an 8, 9, or 10 showing, you just hit the aces instead of splitting them. Follow the golden rule and always split eights and aces no matter what the dealer upcard happens to be. Splitting aces will result in significant gains for the player. Splitting 8's for the most part is a defensive play that will cut down on your losses. But keep in mind you will lose your fair share of hands when you split 8's, but if you were. A split pair of eights is expected to win against dealer upcards of 2 through 7 and to lose less against dealer upcards of 8 through ace. If a player hits on a pair of eights, he is expected to lose $52 for a $100 bet. If the player splits the eights, he is expected to lose only $43 for a $100 bet. The only time I would ever think you could justify not splitting 8s is if you're counting and the count is really negative AND it's late in the shoe. And if the count ever got negative enough for you to attempt this, chances are you've probably already walked away from the table due to the poor count. So yes, always split 8s against a 10. In fact, splitting 8s is recommended by basic strategy most of the time with very few exceptions. This applies to most blackjack variations regardless of deck number, the dealer’s standing rules, and other playing conditions. But as is the case with all rules, there are exceptions to be made.

Introduction

In this post I would like to describe options for splitting concatenated string into multiple rows using SQL in SAP HANA. Depending on which version of HANA system you are working you can choose the one which is valid.

Creating custom function (when SAP HANA system version is 2.0 SP02 or lower)

If your HANA system is of version 2.0 SP2 or older, then there is no in-built function for splitting strings, that’s why you will need to create custom function.

Scenario 1.

You have the comma separated string ‘A1,A2,A3,A4,A5,A6’ which you want to display as multiple rows. Below there is a code for table function splitting comma separated string into multiple lines.

*If your string is separated by different delimiter simply replace ',' with other symbol.

Now let’s query the function for the string which we need to split:

Result:

Using SQLSCRIPT built-in Library (recommended when SAP HANA version is 2.0 SP03 or higher)

Split 8/10

Version 2.0 SP03 of SAP HANA offers new enhancement of SQLScript library – SQLSCRIPT_STRING. Functions within this library enables easy way of splitting string into multiple rows. Additionally developer has more flexibility to define splitting rules.

Scenario 1

You have the comma separated string

which you want to display as multiple rows.

Use following code:

Split

I. Explicitly declare usage of SQLSCRIPT_STRING library. Assign alias for the library (in this example name of the alias is “LIBRARY”, but you can assign any other name)

II.Explicitly declare output table

III.Use SPLIT_TO_TABLE function. Combine it with the alias assigned in point I. As input for SPLIT_TO_TABLE function use string which you want to split, and after comma define delimiter (in this example comma is delimiter). At the end you need to assign output of that function to the table variable defined in point II.

IV. Query the table variable

After running following the query string will be splitted into multiple rows:

Result:

Scenario 2

There is a string which combines first and last name, phone and the address:

You want to split this string into three values: full name, phone, address.

When Do You Split 8s Blackjack

Use following code:

Result:

Here I used third optional parameter (MAXSPLIT) which is available for SPLIT_TO_TABLE and assigned value of 2. This way I will limit the split to only first two comma occurrences (subsequent commas will not be considered).

Besides defining delimiter for split, you can also specify maximum number of splits. Function takes first n-number of delimiter occurences, and remaining part is being displayed in the last row. As you can see in the string from the example there are 4 commas, so if this parameter would not be specified, then in output there would be 5 rows.

Split 8's Against 10

Scenario 3

There is a string which combines number, date and time. It’s separated by #, DATE, TIME string:

You want to split this string into three strings: number, date, time.

Use following code:

Split Second

Output:

Here I used function SPLIT_REGEXPR_TO_TABLE. It can be combined with regular expressions, which gives user even more options for defining logic for splitting strings. Regular expression from the example splits string after each occurencs of # symbol or uppercase alphabet string.

Always Split 8s

Summary

Split

SAP HANA SPS 02 introduced built-in libraries giving SQL developers new functions. In SPS 03 new librarary SQLSCRIPT_STRING has been added which contains multiple functions for manipulating with strings. If you want to find out more about SQLSCRIPT_STRING library, check SQLScript reference by SAP.

Split Second Book

If your system is running on older version of SAP HANA, as workaround you can develop custom function as described in the post.

Split 8s

In my next post you can check how to Split table column value into multiple rows using SQL in SAP HANA

Thanks for reading!