"SQL command not properly ended"

Hi,

Again seeking very novice advice for those willing to point out the basics. I have queried the following and I am still receiving the error. I check each of the first in a long list of User_SampleID individually and I receive back the expected rows.

select SAMPLES, POSITION, TYPE, LOCATION
from CONTAINER_SAMPLES where user_sampleid like ‘BOT2%PC%’,
or user_sampleid like 'BOT3%PC%'
or user_sampleid like 'BOT4%PC%';

  1. 00000 - "SQL command not properly ended"
    *Cause:
    *Action:
    Error at Line: 2 Column: 43

Another user has highlighted the use of OR maybe the obstacle but the issue is highlighted as Line 2.
Any assistance would be appreciated.

Regards

You have a comma in the right/end place

1 Like

select SAMPLES, POSITION, TYPE, LOCATION
from CONTAINER_SAMPLES where user_sampleid like ‘BOT2%PC%’,
or user_sampleid like 'BOT3%PC%',
or user_sampleid like ‘BOT4%PC%’;

So for Line 2 my ending should be something else so the query can search for the second and third line sample data?

Try this :

select SAMPLES, POSITION, TYPE, LOCATION
    from CONTAINER_SAMPLES where user_sampleid like ‘BOT2%PC%’
    or user_sampleid like ‘BOT3%PC%’
    or user_sampleid like ‘BOT4%PC%’;
1 Like