Solved

SQL syntax 'or'.

Posted on 2014-03-26
2
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

710 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