Reputation: 21
db.music.find({deleted: {$ne: true}});
the above code is in mongo db
I want to know how to write the equivalent for this in sql
thank you
Upvotes: 1
Views: 47
Reputation: 1569
Assuming your storing [deleted]
as a bit or nullable bit then :
Select * from [music] where [deleted] != 1
But you can't use sql to query MongoDB, you know that right?
Upvotes: 1
Reputation: 10507
select * from music where deleted != true;
or, optimized:
select * from music where deleted == false;
Depending on the version of SQL, the false
could be 'false'
, 0
or '0'
Assuming:
use my.db
at the beginning of your script)deleted
column is of type boolean or bit.Upvotes: 1