kuselvca 发表于 2010-10-8 16:57:01

以下SQL 语句如果在AU3 中正确执行

$RS.Open("SELECT * FROM tLogs WHERE sCardID = '510107198508214218' GROUP BY sCardID, sCom, cReceived, cRemainBefore, cRemainAfter, dtTime2, iLength ORDER BY dtTime2 DESC" )

kuselvca 发表于 2010-10-8 16:57:31

SELECT sCardID AS 会员卡, sCom AS 机器名, dtTime2 AS 下机时间,
      iLength AS [总上机时(分钟)], cReceived AS 实际消费, cRemainBefore AS 原余额,
      cRemainAfter AS 现余额
FROM tLogs
WHERE (sCardID = '510107198508214218')
GROUP BY sCardID, sCom, cReceived, cRemainBefore, cRemainAfter, dtTime2,
      iLength
ORDER BY dtTime2 DESC

这是原SQL 语句

auto 发表于 2010-10-8 23:13:46

select * 有问题,select 要跟group by 一致才行

shenrenba 发表于 2010-10-9 08:44:39

$path = "数据库路径"
$a = "tLogs"
$b = "510107198508214218"
_SQLite_Open($path)
_SQLite_Query(-1, "SELECT * FROM " & $a & " where sCardID ='" & $b & "';", $hQuery)
While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK
        _GUICtrlListView_AddItem($ListView2, $aRow)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 1)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 2)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 3)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 4)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 5)
        _GUICtrlListView_AddSubItem($ListView2, _GUICtrlListView_FindInText($ListView2, $aRow), $aRow, 6)
WEnd
_SQLite_Close();读取并显示在控件$ListView2上
页: [1]
查看完整版本: 以下SQL 语句如果在AU3 中正确执行