<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Sql on The Lars Breddemann Blog</title><link>https://0608fde9.lbreddemann-blog.pages.dev/tag/sql/</link><description>Recent content in Sql on The Lars Breddemann Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 04 Aug 2023 07:55:06 +0000</lastBuildDate><atom:link href="https://0608fde9.lbreddemann-blog.pages.dev/tag/sql/feed.xml" rel="self" type="application/rss+xml"/><item><title>Tableau repository schedules decoded</title><link>https://0608fde9.lbreddemann-blog.pages.dev/tableau-repository-schedules-decoded/</link><pubDate>Fri, 04 Aug 2023 07:55:06 +0000</pubDate><guid isPermaLink="false">https://www.lbreddemann.org/?p=2244</guid><description>&lt;p&gt;Something (hopefully useful) for the all the Tableau repository warriors:&lt;br&gt;
Table &lt;code&gt;schedules&lt;/code&gt; holds, as the name implies, the definition of &lt;strong&gt;&lt;a href="https://tableau.github.io/tableau-data-dictionary/2023.1/data_dictionary.htm#public.schedules_anchor"&gt;schedules&lt;/a&gt;&lt;/strong&gt; in Tableau Server.&lt;br&gt;
Unfortunately for the SQL user, the information about which day of the week and which day of a month a schedule should trigger an action are encoded in two &lt;code&gt;number&lt;/code&gt; columns via binary encoding.&lt;br&gt;
So, e.g. if the right-most bit of the value in &lt;code&gt;day_of_week_mask&lt;/code&gt; is set, then this schedule triggers stuff on a Sunday.&lt;/p&gt;</description></item><item><title>SAP Factory Calendar in Snowflake</title><link>https://0608fde9.lbreddemann-blog.pages.dev/sap-factory-calendar-in-snowflake/</link><pubDate>Thu, 04 May 2023 08:52:07 +0000</pubDate><guid isPermaLink="false">https://www.lbreddemann.org/?p=2165</guid><description>&lt;p&gt;Analysing the data in SAP systems can be done in many ways. While SAP would like all customers to use the tools from their portfolio, many customers prefer to use other platforms. Snowflake is arguably one of the most popular choices for that.
If getting the SAP tables into a different data platform would be all that is needed to start writing SQL queries and getting answers, I suspect a lot more SAP customers would move their analytics stack. Alas, it is not that easy at all.
SAP&amp;rsquo;s database design is peculiar and littered with design choices from decades long past, when saving a few bytes in storage could greatly improve the system&amp;rsquo;s performance or reduce it&amp;rsquo;s resource consumption.&lt;/p&gt;</description></item><item><title>Answers Pinboard</title><link>https://0608fde9.lbreddemann-blog.pages.dev/answers-pinboard/</link><pubDate>Mon, 19 Dec 2022 04:33:45 +0000</pubDate><guid isPermaLink="false">https://www.lbreddemann.org/?p=1937</guid><description>&lt;p&gt;Apart from writing blog posts I have written answers to many questions on several Q&amp;amp;A sites like &lt;a href="https://stackoverflow.com/questions/tagged/hana"&gt;StackOverflow&lt;/a&gt; and &lt;a href="https://answers.sap.com/tags/73554900100700000996"&gt;SAP Community&lt;/a&gt;. Some of those answers received good feedback and/or the answer surprised me once I worked it out.&lt;/p&gt;</description></item><item><title>SAP HANA middle of the road for Big Data or just average?</title><link>https://0608fde9.lbreddemann-blog.pages.dev/sap-hana-middle-of-the-road-for-big-data-or-just-average/</link><pubDate>Sun, 14 Aug 2022 12:41:02 +0000</pubDate><guid isPermaLink="false">https://www.lbreddemann.org/?p=2068</guid><description>&lt;p&gt;When SAP tries to explain HANA as a technology the buzz words &amp;ldquo;Big Data&amp;rdquo; have always been part of the story.&lt;br&gt;
Commonly &amp;ldquo;Big Data with HANA&amp;rdquo; then gets specified to mean one or another thing - often to caveat what the platform is supposed to be able to do and which usage scenarios require what sort of special handling.&lt;/p&gt;</description></item><item><title>Separate business logic from tables and avoid dynamic SQL</title><link>https://0608fde9.lbreddemann-blog.pages.dev/separate-business-logic-from-tables-and-avoid-dynamic-sql/</link><pubDate>Sun, 15 Nov 2020 06:18:51 +0000</pubDate><guid isPermaLink="false">https://www.lbreddemann.org/?p=1745</guid><description>&lt;h2 id="real-programming"&gt;Real programming &lt;a class="heading-anchor" href="#real-programming" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;One of the aspects of doing &amp;ldquo;actual&amp;rdquo; programming is to &lt;em&gt;automate&lt;/em&gt; computations. Making the computer do things not just once, say by running a calculation on the October sales data, but to do it over and over again on any months&amp;rsquo; sales data.&lt;/p&gt;</description></item><item><title>Matchmaker - quick quick?</title><link>https://0608fde9.lbreddemann-blog.pages.dev/matchmaker-quick-quick/</link><pubDate>Thu, 26 Mar 2020 05:07:37 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=1402</guid><description>&lt;p&gt;In &lt;a href="https://0608fde9.lbreddemann-blog.pages.dev/matchmaker/"&gt;Matchmaker&lt;/a&gt;, I developed a solution to a not-so-obvious problem.&lt;/p&gt;
&lt;p&gt;The solution worked and delivered the right answer - finding documents where the line items match to a certain degree the line items of a reference document.&lt;/p&gt;</description></item><item><title>Matchmaker</title><link>https://0608fde9.lbreddemann-blog.pages.dev/matchmaker/</link><pubDate>Thu, 26 Mar 2020 05:07:31 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=1386</guid><description>&lt;p&gt;SQL is an easy language to learn. A few commands to learn ( &lt;code&gt;SELECT/FROM/WHERE/GROUP BY&lt;/code&gt;) and you are good to go.&lt;/p&gt;
&lt;p&gt;One downside of the simple syntax and small vocabulary is that it can lead many SQL users to the assumption that these building blocks are all that can be expressed with SQL.&lt;/p&gt;</description></item><item><title>Be careful with dates and timestamps</title><link>https://0608fde9.lbreddemann-blog.pages.dev/be-careful-with-dates-and-timestamps/</link><pubDate>Thu, 05 Mar 2020 03:11:11 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=1352</guid><description>&lt;p&gt;A recent &lt;a href="https://stackoverflow.com/questions/60500681/how-to-format-date-in-where"&gt;question&lt;/a&gt; on StackOverflow about how to &amp;ldquo;format&amp;rdquo; date values in &lt;code&gt;WHERE&lt;/code&gt;-conditions in HANA brought up an aspect of date-handling that is easily overlooked and that can lead to unexpected results.&lt;/p&gt;</description></item><item><title>SAP Inside Track #sitMEL – Full Day Event in Melbourne</title><link>https://0608fde9.lbreddemann-blog.pages.dev/sap-inside-track-sitmel-full-day-event-in-melbourne/</link><pubDate>Mon, 17 Feb 2020 03:01:33 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=1332</guid><description>&lt;p&gt;On Saturday, 15.02.2020, a rather rain-drenched stormy day in Melbourne, Australia, the &lt;a href="https://blogs.sap.com/2020/01/19/sap-inside-track-sitmel-full-day-event-in-melbourne-15th-feb-2020/"&gt;SAP Inside Track #sitMEL – Full Day Event&lt;/a&gt; was held.&lt;/p&gt;
&lt;p&gt;I was honored to get a speaker slot and the chance to talk about &amp;ldquo;&lt;a href="https://0608fde9.lbreddemann-blog.pages.dev/wp-content/uploads/2020/02/Humane-DB-design-and-programming.pdf"&gt;Humane DB design and programming&lt;/a&gt;&amp;rdquo;.&lt;/p&gt;</description></item><item><title>Types of NULL</title><link>https://0608fde9.lbreddemann-blog.pages.dev/types-of-null/</link><pubDate>Mon, 13 Jan 2020 06:00:58 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=1237</guid><description>&lt;p&gt;This is about an error I ran into while fiddling with an SQL query. Since it was not immediately obvious to me what was the cause this makes a good topic for a new post.&lt;/p&gt;</description></item><item><title>Conditionally unique</title><link>https://0608fde9.lbreddemann-blog.pages.dev/conditionally-unique/</link><pubDate>Fri, 22 Mar 2019 04:37:32 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=1119</guid><description>&lt;p&gt;A common requirement for SQL DB modeling is to have something that could be called &lt;strong&gt;conditional unique constraint&lt;/strong&gt;.&lt;br&gt;
The idea is that certain combinations of column values should only occur once if at all, while other combinations are allowed to occur in any number.&lt;/p&gt;</description></item><item><title>New year, same issues and some tips.</title><link>https://0608fde9.lbreddemann-blog.pages.dev/new-year-same-issues-and-some-tips/</link><pubDate>Tue, 08 Jan 2019 04:34:44 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=1064</guid><description>&lt;p&gt;Most folks working with SQL DBs for a while will likely come to see how beginners in this area struggle with &amp;ldquo;declaritive code&amp;rdquo; and &amp;ldquo;tell the DB what you want not how to do it&amp;rdquo;&lt;/p&gt;</description></item><item><title>SQL refactoring example</title><link>https://0608fde9.lbreddemann-blog.pages.dev/sql-refactoring-example/</link><pubDate>Mon, 03 Dec 2018 13:06:34 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=1036</guid><description>&lt;p&gt;About a year ago I answered &lt;a href="https://answers.sap.com/questions/387588/convert-oracle-if-statement-to-hana.html"&gt;a question&lt;/a&gt; on the SAP Community Q&amp;amp;A site and have it on my posts-to-write list ever since to turn it into a blog post.&lt;/p&gt;
&lt;p&gt;I feel that I learn a lot from seeing applied examples of concepts and rules - for example from &lt;a href="https://www.youtube.com/watch?v=FyCYva9DhsI"&gt;this&lt;/a&gt; great presentation from &lt;a href="https://twitter.com/KevlinHenney"&gt;Kevlin Henney&lt;/a&gt; that includes a &amp;ldquo;talk-through&amp;rdquo; a refactoring example. So, this is my example for others to review.&lt;/p&gt;</description></item><item><title>IF EXISTS would exist</title><link>https://0608fde9.lbreddemann-blog.pages.dev/if-exists-would-exist/</link><pubDate>Wed, 28 Nov 2018 04:54:55 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=996</guid><description>&lt;p&gt;A recurring question of folks using SAP HANA is how to only run a &lt;code&gt;DROP&lt;/code&gt; command for objects that actually exist in the database. One could argue that the effect of executing &lt;code&gt;DROP&lt;/code&gt; does not depend on whether the object to be dropped exists, because after running the command it will not be there either way, but there is a bit more to it.&lt;/p&gt;</description></item><item><title>Is SAP HANA SQL/SQLScript Turing complete?</title><link>https://0608fde9.lbreddemann-blog.pages.dev/is-sap-hana-sql-sqlscript-turing-complete/</link><pubDate>Thu, 01 Feb 2018 01:30:07 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=770</guid><description>&lt;p&gt;There was an interesting (aka nerdy) question in the SAP Community Q&amp;amp;A the other day:&lt;/p&gt;
&lt;p&gt;&amp;ldquo;&lt;a href="https://answers.sap.com/questions/419209/are-sqlscript-and-hana-sql-turing-complete.html"&gt;Are SQLScript and HANA SQL&lt;/a&gt; Turing complete?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;I took a swing at it and the following is my result (a slightly edited version of my original answer).&lt;/p&gt;</description></item><item><title>What's your number?</title><link>https://0608fde9.lbreddemann-blog.pages.dev/whats-your-number/</link><pubDate>Wed, 15 Nov 2017 05:05:49 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=141</guid><description>&lt;p&gt;Have you been using the &lt;code&gt;ISNUMERIC&lt;/code&gt; function of MySQL, MS SQL Server or PostgreSQL and wondered what to use in SAP HANA instead? If so, this is the blog post for you.&lt;/p&gt;</description></item><item><title>Eco-friendly slide recycling with HANA</title><link>https://0608fde9.lbreddemann-blog.pages.dev/eco-friendly-slide-recycling-with-hana/</link><pubDate>Sun, 02 Apr 2017 14:00:06 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=46</guid><description>&lt;p&gt;Hey there!&lt;/p&gt;
&lt;p&gt;I recently presented a short session on my experiences with developing and debugging non-classic-SAP HANA solutions at the &lt;a href="http://completestream.com.au/event-summary-2017/"&gt;Leading Insights&lt;/a&gt; conference in Melbourne (27./28.3.2017).&lt;/p&gt;
&lt;p&gt;And since the slides are prepared in a way that they could be used without my talking as well, I thought, I might just post them. So, there they are on slideshare:&lt;/p&gt;</description></item><item><title>On multiple mistakes with IN conditions</title><link>https://0608fde9.lbreddemann-blog.pages.dev/on-multiple-mistakes-with-in-conditions/</link><pubDate>Thu, 02 Jun 2016 14:00:59 +0000</pubDate><guid isPermaLink="false">https://lbreddemann.org/?p=184</guid><description>&lt;p&gt;&lt;strong&gt;Based on SAP HANA SPS 11&lt;/strong&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="update-162017"&gt;Update 1.6.2017 &lt;a class="heading-anchor" href="#update-162017" aria-label="Link to this section"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Retesting the &lt;code&gt;APPLY_FILTER()&lt;/code&gt; approach on rev. 112.07 showed that it is now possible to simply hand &lt;code&gt;APPLY_FILTER() &lt;/code&gt; an IN condition with a list of integers.&lt;/p&gt;</description></item><item><title>Fiddle riddle – Amazing: stuff gets faster and takes less space!</title><link>https://0608fde9.lbreddemann-blog.pages.dev/fiddle-riddle-amazing-stuff-gets-faster-and-takes-less-space/</link><pubDate>Sat, 15 Aug 2015 14:00:40 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=275</guid><description>&lt;p&gt;In &lt;a href="https://0608fde9.lbreddemann-blog.pages.dev/quick-notes-during-a-fiddle-session/"&gt;Quick notes during a fiddle-session&lt;/a&gt; I played around with a table that contained all possible values for a date column.&lt;/p&gt;
&lt;p&gt;To fill it I used a &lt;code&gt;FOR LOOP&lt;/code&gt; with an &lt;code&gt;INSERT&lt;/code&gt; and a &lt;code&gt;COMMIT&lt;/code&gt; every &lt;code&gt;10000&lt;/code&gt; records. That took &lt;strong&gt;9:37 minutes&lt;/strong&gt; for 3.652.061 records. That&amp;rsquo;s terrible performance and nothing that needs to be accepted with SAP HANA!&lt;/p&gt;</description></item><item><title>Quick notes during a fiddle-session</title><link>https://0608fde9.lbreddemann-blog.pages.dev/quick-notes-during-a-fiddle-session/</link><pubDate>Sat, 15 Aug 2015 14:00:22 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=277</guid><description>&lt;p&gt;For a while now I am working as a Solution Architect for the &lt;a href="http://www.sap.com/services-support/svc/custom-app-development.html"&gt;SAP Custom Development&lt;/a&gt; organisation. This is the team you&amp;rsquo;d call when you want custom-built solutions that perfectly fit into your standard solution landscape.&lt;/p&gt;</description></item><item><title>The 7th Niceness of new toys’n’tools</title><link>https://0608fde9.lbreddemann-blog.pages.dev/the-7th-niceness-of-new-toysntools/</link><pubDate>Fri, 05 Jun 2015 14:00:37 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=286</guid><description>&lt;p&gt;If you&amp;rsquo;re not living behind some red moon and you&amp;rsquo;re reading this blog, you will likely be aware that SAP HANA SPS 10 had just been released.&lt;/p&gt;
&lt;p&gt;With it also the SAP HANA Studio had been improved and extended.&lt;/p&gt;</description></item><item><title>Quick note on IDENTITY column in SAP HANA</title><link>https://0608fde9.lbreddemann-blog.pages.dev/quick-note-on-identity-column-in-sap-hana/</link><pubDate>Tue, 03 Jun 2014 14:00:35 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=352</guid><description>&lt;p&gt;Not sure you knew this already, but starting with SPS 8 (seemed to work with Rev. 74 as well), SAP HANA comes with an option to have an &lt;strong&gt;IDENTITY&lt;/strong&gt; column in column store tables.&lt;/p&gt;</description></item><item><title>Of groups of serial shoppers…</title><link>https://0608fde9.lbreddemann-blog.pages.dev/of-groups-of-serial-shoppers/</link><pubDate>Wed, 28 May 2014 14:00:03 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=354</guid><description>&lt;p&gt;&lt;strong&gt;based on SAP HANA revision 74&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;raquo;&amp;gt; update 09.02.2016 &amp;laquo;&amp;lt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you are trying to work on a similar problem, please make sure to also review the solutions posted in discussion &lt;a href="http://scn.sap.com/thread/3777931"&gt;Fetch the first record with 24 hr interval based on first record timestamp&lt;/a&gt;. The solutions posted there are much more efficient and solve the problem better in multiple ways.&lt;/p&gt;</description></item><item><title>Show me the timelines, baby!</title><link>https://0608fde9.lbreddemann-blog.pages.dev/show-me-the-timelines-baby/</link><pubDate>Wed, 19 Dec 2012 14:00:26 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=498</guid><description>&lt;p&gt;&lt;strong&gt;Based on revision 46 (SPS 5) of SAP HANA Studio and Database&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hello once again!&lt;/p&gt;
&lt;p&gt;While reading through the recently released SPS 05 RKT material (&lt;a href="http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000755836&amp;amp;_SCENARIO=01100035870000000202&amp;amp;"&gt;here&lt;/a&gt;) &lt;em&gt;(that is, IF&lt;/em&gt; &lt;em&gt;you have access to this RKT material)&lt;/em&gt;, specifically the &amp;ldquo;&lt;a href="https://websmp201.sap-ag.de/~sapidb/011000358700001303582012E.pdf"&gt;What&amp;rsquo; New Admin &amp;amp; Monitoring&lt;/a&gt;&amp;rdquo; document I found that the authors mentioned that the plan visualization feature we got in SPS 04 had been improved by adding an &lt;strong&gt;execution timeline&lt;/strong&gt; to the display.&lt;/p&gt;</description></item><item><title>Starting off with a classic…</title><link>https://0608fde9.lbreddemann-blog.pages.dev/starting-off-with-a-classic/</link><pubDate>Tue, 13 Feb 2007 14:00:09 +0000</pubDate><guid isPermaLink="false">http://lbreddemann.org/?p=370</guid><description>&lt;p&gt;Every now and then a new version of the database software comes along. Upgrades of Oracle or MaxDB often include major improvements concerning stability and performance. These improvements can and should be read as: things run different now.&lt;/p&gt;</description></item></channel></rss>