Adjit Adjit - 7 months ago 7
SQL Question

SQL Select all rows with specific value

Trying to select all rows with the value

33487MO
in the column
ORMSTRID


This is my current query -

SELECT * from MyTable
Where ORMSTRID = "33487MO"


But it gives me an error that is saying
Invalid column name '33487MO'


SELECT * from MyTable


shows me all of the rows and columns from the table, and
ORMSTRID
is definitely the column name.

Answer

You should use single quote with string data According your example your query should be:

select * from mytable
where ORMSTRID like '33487MO'