0

`

<fx:Script>
    <![CDATA[
        import mx.collections.ArrayCollection;
        import spark.events.ViewNavigatorEvent;     

        protected var sqlConnection:SQLConnection;

        protected function view1_viewActivateHandler(event:ViewNavigatorEvent):void
        {
            sqlConnection = new SQLConnection();
            sqlConnection.open(File.applicationStorageDirectory.resolvePath("euro.db"));
            getAllGiberish();
        }

        protected function getAllGiberish():void
        {
            var stmt:SQLStatement = new SQLStatement();
            stmt.sqlConnection = sqlConnection;
            stmt.text = "SELECT esteso FROM generale GROUP BY nazione, esteso HAVING nazione = 'Austria'";
            stmt.execute();
            list.dataProvider = new ArrayCollection(stmt.getResult().data);         
        }       

    ]]>

</fx:Script>

<s:List id="list" x="4" y="5" width="306" height="274" />

因为我没有在列表中得到任何数据?我做错了什么?我在 generale 表 id、valore、moneta、esteso 中有 4 个字段

4

1 回答 1

1

我不是专家,但我首先认为 SQL 语句可能格式错误,我认为它用于聚合函数,所以会

SELECT esteso FROM generale WHERE nazione = 'Austria' GROUP BY nazione, esteso;

虽然我刚刚注意到这是从 8 月 23 日开始的,但您可能已经对其进行了排序。

杰克

于 2012-11-16T15:10:29.033 回答