Sign in to follow this  
Followers 0
autoitxp

SQLite Queries

2 posts in this topic

#1 ·  Posted (edited)

Hi i decided to share some usefull sqlite Queries to get date fast

To count all records :

select COUNT(*) from mytable;

To get singal row or many you want : best and very fast for me

SELECT * FROM  mytable ORDER BY rowid DESC limit 1  offset 0;

this will show 20 to 10 records order by ASC

SELECT * FROM  mytable ORDER BY rowid ASC limit 10  offset 20;

if you have any good queries to get data fast share it

Regards

Sim

Edited by autoitxp

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Heres a quick one resulting from some help from Psalty when I first started learning Autoit (Update Query)

$sExec = "UPDATE Users SET Department='Marketing' WHERE User_Name='" & $UserName & "'" ; Change a record
If _SQLite_Exec($hDB, $sExec) = $SQLITE_OK Then ConsoleWrite("Debug:  Successfully updated a record." & @LF)
Edited by Hatcheda

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0