Solved

SQL syntax 'or'.

Posted on 2014-03-26
2
266 Views
Last Modified: 2014-03-26
Is the syntax correct for the statement below? I am not sure of the multiple usage of the 'or'.  We are checking for the existance of all possible image files.

select top 1 @filename_to_import = line from _gpg_filenames where line like '%.jpg' or '%.jpeg’ or ‘%.jfif’ or ‘%.gif’ or ‘%.giff’ or ‘%.bmp’ or ‘%.png’ or ‘%.tiff’
0
Comment
Question by:tesla764
2 Comments
 
LVL 34

Accepted Solution

by:
johnsone earned 500 total points
ID: 39957379
You have to repeat the condition.

select top 1 @filename_to_import = line from _gpg_filenames where line like '%.jpg' or line like '%.jpeg’ or line like ‘%.jfif’ or line like ‘%.gif’ or line like ‘%.giff’ or line like ‘%.bmp’ or line like ‘%.png’ or line like ‘%.tiff’
0
 

Author Closing Comment

by:tesla764
ID: 39957394
Thanks.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now