H
H
heIIfire2017-01-03 01:52:55
MySQL
heIIfire, 2017-01-03 01:52:55

SQL queries. Why is string data enclosed in quotes?

Why is string data enclosed in quotes?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Cat Anton, 2017-01-03
@27cm

To make it clear where the line starts and where it ends. Compare:

SELECT * FROM table WHERE field1 = value1 OR field2 = value2;
SELECT * FROM table WHERE field1 = 'value1 OR field2 = value2';

A
Arman, 2017-01-03
@Arik

Not to fulfill, but to keep. If you want to save the request code, then how to distinguish what needs to be saved and what needs to be executed?

INSERT INTO `table` ... `text` = Привет SELECT * FROM admins limit 1
?
INSERT INTO `table` ... `text` = "Привет SELECT * FROM admins limit 1"
+
And how to distinguish the name of your field from the function?
SELECT COUNT(COUNT)?
SELECT COUNT(`count`)+

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question