سؤال

I have table created by ORM named 'key'. 'key' is MySQL keyword so I cannot select it just SELECT * FROM key;.

How to perform select from table named 'key' in MySQL?

هل كانت مفيدة؟

المحلول

Try to escape your table name with backticks `

SELECT * FROM `key`

This will make your database understand key is a table

نصائح أخرى

you can do

select * from [key]
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top