Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 294
  • Last Modified:

SQL syntax 'or'.

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
tesla764
Asked:
tesla764
1 Solution
 
johnsoneSenior Oracle DBACommented:
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
 
tesla764Author Commented:
Thanks.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now