Method and system for rewriting a database query
The invention relates to a method and database system for rewriting a SQL query having at least one null sensitive expression (NSE) in a select list of the query, the query comprising at least one outer join command to be performed on at least two tables and involving a view or a Derived Table (DT)....
Gespeichert in:
Hauptverfasser: | , , |
---|---|
Format: | Patent |
Sprache: | eng |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention relates to a method and database system for rewriting a SQL query having at least one null sensitive expression (NSE) in a select list of the query, the query comprising at least one outer join command to be performed on at least two tables and involving a view or a Derived Table (DT). The method comprising the steps of: identifying at least one unmatching row belonging to the view or DT using non-nullable fields that belong to the outermost table in the view or DT; converting the NSE(s) from the at least one identified rows into a SQL case construct; and performing the at least one outer join. The database system comprising means for rewriting a SQL query having at least one null sensitive expression (NSE) in a select list of the query, the query comprising at least one outer join command to be performed on at least two tables and involving a view or a Derived Table (DT). The system comprises a device configured to identify at least one unmatching row belonging to the view or DT using non-nullable fields that belong to the outermost table in the view or DT; a device configured to convert the NSE(s) from the at least one identified rows into a SQL case construct; and a device configured to perform the at least one outer join. |
---|