Book a Demo

Author Topic: SQL query: how to use "like" in "where" clause?  (Read 5479 times)

ngong

  • EA User
  • **
  • Posts: 275
  • Karma: +2/-2
    • View Profile
SQL query: how to use "like" in "where" clause?
« on: May 04, 2018, 08:13:49 pm »
I tried like

select * from t_xref where Description like "%stereo1%stereo2%"

without success. I could not find any "like" example on Geert Belekens website or in the book of Thomas Kilian.
Rolf

ngong

  • EA User
  • **
  • Posts: 275
  • Karma: +2/-2
    • View Profile
Re: SQL query: how to use "like" in "where" clause?
« Reply #1 on: May 04, 2018, 08:18:09 pm »
Found the answer:

as opposed to the link http://www.1keydata.com/sql/sql-commands.html found in the book of Thomas Kilian, it is "*" to be used, not "%".
Rolf

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SQL query: how to use "like" in "where" clause?
« Reply #2 on: May 04, 2018, 08:45:29 pm »
In EA you can use #WC# which will be translated to the correct wildcard by EA (* for .eap(x) files, and % for anything else)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: SQL query: how to use "like" in "where" clause?
« Reply #3 on: May 05, 2018, 01:09:18 am »
As Geert said. Mickeysoft has (like always) its own way to interpret a standard. That's the Mickeysoft Standard. Hence MS.

q.