Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
\\

*SQL strings* enable the application of *advanced filters* within [SAP2000|sap2000:home]. The SQL string entered into SAP2000 corresponds to the portion of the full SQL Select Statement which follows the [SQL Where Clause |{new-tab-link:http://www.w3schools.com/sql/sql_where.asp]}SQL Where Clause{new-tab-link}. To demonstrate, advanced filtering will be applied, using SQL strings, to the Joint Coordinates table of Verification Example 1-024 as follows:


h1. Report 1

*Report 1* selects all [joints|kb:Joint] where the X coordinate is greater than 1.0, then organizes the data in order of XorR, Y, and Z coordinates using the SQL string which follows:

{code}
XorR > 0 ORDER BY XorR, Y, Z
{code}

The application of this advanced filter SQL string is shown in Figure 1:

\\

!Applying_advanced_filters_via_SQL_strings_string_1.png|align=center,border=0!

{center-text}Figure 1 - Advanced filter SQL string{center-text}

\\

Data is organized accordingly in the Joint Coordinates table, as shown in Figure 2:

\\

!Applying_advanced_filters_via_SQL_strings_table_1.png|align=center,border=0!

{center-text}Figure 2 - Joint Coordinates table{center-text}


h1. Report 2

*Report 2* selects all joints with a Z coordinate between 12 and 14, then organizes the data by XorR, Y, and Z coordinates using the SQL string which follows:

{code}
Z > 12 AND Z < 14 ORDER BY XorR, Y, Z
{code}

The application of this advanced filter SQL string is shown in Figure 3:

\\

!Applying_advanced_filters_via_SQL_strings_string_2.png|align=center,border=0!

{center-text}Figure 3 - Advanced filter SQL string{center-text}

\\

Data is organized accordingly in the Joint Coordinates table, as shown in Figure 4:

\\

!Applying_advanced_filters_via_SQL_strings_table_2.png|align=center,border=0!

{center-text}Figure 4 - Joint Coordinates table{center-text}


h1. External Links

* [SQL Where Clause |{new-tab-link:http://www.w3schools.com/sql/sql_where.asp] - w3schools.com}SQL Where Clause{new-tab-link} \- SQL tutorial
 by w3schools.com