Home > Software engineering >  Oracle SQL Syntax meaning
Oracle SQL Syntax meaning

Time:12-02

I am debugging someone's Oracle/Java program that I inherited. I know Oracle fairly well (SQL) but I ran into this sequence which confuses me. I made generic table names but the rest is right:

 select min(latitude), min(longitude) from mytable.myrecord where zip like ? || '%'

Now this is a prepared statement so they set the "?" to "10003" to search for that zipcode in NY. What I don't understand is the "OR" part (||). Doesn't that mean zip is like 10003 or zip is like '%', which would match anything?

CodePudding user response:

it is not OR.It is string concatenation https://docs.oracle.com/cd/B19306_01/server.102/b14200/operators003.htm

  • Related