Home SQL if statment
Reply: 0

SQL if statment

user626
1#
user626 Published in June 18, 2018, 3:37 am

I have this SQL query:

Select 
   * from dbo.Users 
WHERE 
   numOfScans == 0 feedback >= {0} 
AND 
   feedback <= {1} 
ORDER BY 
   lastScan ASC

It bring me all the users that the numOfScans is zero. I have another case that if this SELECT bring me zero results so i don't want to use numOfScans, something like:

Select 
  * from dbo.Users 
WHERE 
  feedback >= {0} AND feedback <= {1} 
ORDER BY 
  lastScan ASC

It's possible to do this in the same query? Or I need a new query for that?

Sql
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.304249 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO