Correlation between intelligence and ethics, nor is ruthlessness

There is no predictable correlation between intelligence and ethics, nor is ruthlessness necessarily an evil thing. And there is nothing like enforced, uninterrupted contemplation to learn to distinguish one from another….

— JAMES H. SCHMITZ

Netezza / PureData – How To Quote a Single Quote in Netezza SQL

How To Quote a Single Quote in Netezza SQL?

The short answer is to use four single quotes (””), which will result in a single quote within the select statement results.

How to Assemble the SQL to Quote a Single Quote in a SQL Select Statement

Knowing how to construct a list to embed in a SQL where clause ‘in’ list or to add to an ETL job can be a serious time saver eliminating the need to manually edit large lists.  In the example below, I used the Select result set to create a rather long list of values, which needed to be included in an ELT where clause.  By:

  • Adding the comma delimiter (‘,’) and a Concatenate (||) on the front
  • Followed by adding a quoted single Quote (entered as four single quotes (””)) and a Concatenate (||)
  • The Field I which to have delaminated and Quoted (S1.ORDER_NUM)
  • And closed with a quoted single Quote (entered as four single quotes (””))

This results in a delimited and quoted list ( ,’116490856′) which needs only to have the parentheses added and the first comma removed, which is much less work than manually editing the 200 item that resulted from this select.

Example SQL:

SELECT Distinct

‘,’||””|| S1.ORDER_NUM||”” as Quoted_Order_Number

FROM Sales S1

How to Quote A Single Quote Example SQL
How to Quote A Single Quote Example SQL

Related Reference

Mastery – Success Equals Preparation

Maxims And Truisms, Success equals preparation meeting opportunity, mastery,eminence
Success equals preparation

While flipping through some old papers the day I  saw this maxim scribbled down on a piece of paper. This maxim has proven true for many.  there is a high likelihood that folks with a military background have heard it somewhere along the way.

Success Maxim

Success equals preparation meeting opportunity.
This concept is, also sometime said as:

What is Conley’s law?

Acronyms, Abbreviations, Terms, And Definitions, Conley’s Law, What is Conley’s law
Acronyms, Abbreviations, Terms, And Definitions

Conley’s Law

Any organization that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organization’s communication structure.

 

–“How Do Committees Invent?”, Melvin E. Conway, 1968

 

Related References

Harvard Business School

Exploring the Duality between Product and Organizational Architectures: A Test of the “Mirroring” Hypothesis

Information Technology – What is Greer’s Third Law?

Greer's Third Law, Acronyms, Abbreviations, Terms, And Definitions, What is Greer's Third Law
Greer’s Third Law

Greer’s Third Law

A computer program does what you tell it to do, not what you want it to do

Related References