robertohuertasm / SQLite4Unity3d

SQLite made easy for Unity3d
MIT License
1.27k stars 265 forks source link

Query #112

Closed IrfanKureshi8792 closed 3 years ago

IrfanKureshi8792 commented 3 years ago

how to implement select * from where EmployeeName="ABC" AND Designation="HR" ; in Sqlite4unity

georgetye commented 3 years ago

I'm wondering the same thing.

"You’re done! Now you can get access to your database using sqlite-net. ;P"

Except there's no explanation on how to do that? Maybe I'm just too much of a noob.

robertohuertasm commented 3 years ago

HI @IrfanKureshi8792 and @georgetye, please take a look at sqlite-net wiki for more information on how to use it.

You can use pure sql:

string query = $"SELECT * FROM records";
var results = conn.Query<Record>(query);

or linq:

var results = conn.Table<Record>().Where(t => t.Age > 40).OrderByDescending(t => t.Age).ToList();

See the Synchronouse API docs.

georgetye commented 3 years ago

Ah ok perfect, thanks so much!