I have a SQL SELECT Statement:
SELECT Code, Description
FROM Table1
WHERE (Code='a' and Amount>100) or (Code='b' and Amount<100)
I wish to use XML to present the 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 satisfy with it. It is much more complicated to find a XSD for SQL SELECT statement. They are many features in SQL SELECT statement that I haven't included, e.g.: Aggregates, Inner/Outer Join, Between, IN, Sub Select and etc.
It is beyond my capabilities to design such schema. Does anyone know if there is such XSD to for SQL Select statement presentation?