I have a SQL SELECT statement:
SELECT Code, Description
FROM Table1
WHERE (Code='a' and Amount>100) or (Code='b' and Amount<100)
I want to use XML to represent a SELECT statement. Here is my initial design:
<select table="Table1">
<columns>
<column name="Code"/>
<column name="Description"/>
</columns>
<filters>
<or>
<and>
<filter field="Code" cond="eq" value="a"/>
<filter field="Amount" cond="gt" value="100"/>
</and>
<and>
<filter field="Code" cond="eq" value="b"/>
<filter field="Amount" cond="lt" value="100"/>
</and>
</or>
</filters>
</select>
However, I am not satisfied with this. It's much harder to find an XSD statement for SQL SELECT. They have many functions in the SQL SELECT statement that I did not include, for example: Aggregates, Internal / External Connections, Between, IN, Sub Select, etc.
I can not develop such a scheme. Does anyone know if there is such an XSD to represent the SQL Select clause?
source
share