|
[QODBC-Desktop] How to use SQL functions in QODBC
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 04:01 PM
|
|
|
QODBC does support standard SQL queries, but the function is implemented differently. Please refer to the functions below & try to execute them in QODBC Test Tool. Functions in Select Query:You can use distinct like: Please refer to the article below for more information: SELECT * from customer WHERE TimeModified IN (SELECT TimeModified from customer WHERE TimeCreated < {ts '2007-06-17 00:00:00.000'})
SELECT * from customer WHERE ListID IN (SELECT CustomerRefListID from Invoice WHERE TimeCreated > {ts '2026-06-17 00:00:00.000'})
Group By select txndate, sum(subtotal) as AmountDateWise from Invoice group by txndate
Function Sub with Date Range select txndate, sum(subtotal) as AmountDateWise from Invoice where TimeCreated >= {ts '2003-01-01 00:00:00.000'} and TimeCreated <= {ts '2035-01-01 00:00:00.000'} group by txndate
SELECT Customer.CompanyName, Customer.FullName, SUM(Invoice.Subtotal) AS TotalAmount, SUM(Invoice.SalesTaxTotal) AS TotalTax FROM
SELECT Customer.CompanyName, Customer.FullName, SUM(Invoice.Subtotal) AS TotalAmount, SUM(Invoice.SalesTaxTotal) AS TotalTax, Functions in Update Query:You can replace functions in the Update query like: UPDATE TableName SET ColumnName = {fn REPLACE("ColumnName",'ValueToFind','ValueToReplace')} WHERE (condition) For Example: UPDATE Invoice SET RefNumber = {fn REPLACE("RefNumber",'71047','0777')} WHERE (TxnDate>{d '2012-12-31'}) You can change the table name & column name as per your requirement. | |
|
|


