-3
Select COLUMN_name  
from TABLE_name 
where COLUMN NAME = 'something's'

While executing this query in PostgreSQL, it is showing an error as like below, syntax error at or near "S".

murthy naika k
  • 559
  • 6
  • 12
  • 2
    If you study this in your SQL editor, does anything pop-out at you? Even just studying this with your eyes, does the embedded **single quote** mean anything of importance? – Dave Alperovich Nov 06 '13 at 08:02

1 Answers1

2

The apostrophe in KEPLER'S is terminating the string early. Escape it, and proofread next time.

Select CONCEPTNAME from KM_CONCEPT_MAST where CONCEPTNAME='KEPLER''S LAWS OF PLANETARY MOTION'
Community
  • 1
  • 1
Matt Ball
  • 354,903
  • 100
  • 647
  • 710