The Anatomy of a SQL Statement – The Basics (Part 1)

The Basics
Writing your own query for SAP (or any system) can be very satisfying and cost effective, if you are a user of SBO. Once you understand the basics, you will be able to direct your computer to give you exactly what information you are looking for from the system.
Most systems have some common elements such as Customers, Vendors, Items, and Orders. SBO is no different than any other system in that regard. Each of those elements are stored in tables (or files). If you are familiar with Excel Spreadsheets, then you can grasp the concept of a table. A Table stores information in rows, and for each row, the columns represent different pieces of information that are specific to the row. For example, if we were to look a Customer Master table, the customer numbers would appear in the first column and the corresponding customer name would appear in the second (just like an Excel spreadsheet).
Every system (SAP, MS, etc.) probably has a customer master, but the name of the table is different from one system to another. In SBO, the customer master is called “OCRD”. This is the name that you will use to refer to the customer master in your queries.
Let’s write a query statement in plain English first to get an idea of what information we would like to get out of the system:
“I would like to have a list of all of the customer numbers and names.”
After converting the statement to SQL we will have:
SELECT CardCode, CardName FROM OCRD
Part 2 is HERE.
Thanks to Ed Monk of SBONotes.com

2019-01-16T11:44:20+00:00 February 11th, 2009|SAP Business One|Comments Off on The Anatomy of a SQL Statement – The Basics (Part 1)