fix: converted single to triple backticks14 (#36241)
This commit is contained in:
@@ -18,66 +18,73 @@ localeTitle: SQL LIKE المشغل
|
||||
|
||||
سيحدد هذا SQL الطلاب الذين لديهم `FullName` بدءًا من "Monique" أو تنتهي بـ "Greene".
|
||||
|
||||
`SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE
|
||||
FullName LIKE 'Monique%' OR -- note the % at the end but not the beginning
|
||||
FullName LIKE '%Greene'; -- note the % at the beginning but not the end
|
||||
`
|
||||
```sql
|
||||
SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE
|
||||
FullName LIKE 'Monique%' OR -- note the % at the end but not the beginning
|
||||
FullName LIKE '%Greene'; -- note the % at the beginning but not the end
|
||||
```
|
||||
|
||||
`+-----------+---------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+---------------+-----------+---------------------+
|
||||
| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 |
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
+-----------+---------------+-----------+---------------------+
|
||||
2 rows in set (0.00 sec)
|
||||
`
|
||||
```text
|
||||
+-----------+---------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+---------------+-----------+---------------------+
|
||||
| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 |
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
+-----------+---------------+-----------+---------------------+
|
||||
2 rows in set (0.00 sec)
|
||||
```
|
||||
|
||||
### يوجد نمط سلسلة في منتصف العمود
|
||||
|
||||
سيحدد هذا SQL الطلاب الذين لديهم "ree" في أي مكان في الاسم.
|
||||
|
||||
`SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE FullName LIKE '%ree%'; -- note the % at the beginning AND at the end
|
||||
`
|
||||
```sql
|
||||
SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE FullName LIKE '%ree%'; -- note the % at the beginning AND at the end
|
||||
```
|
||||
|
||||
`+-----------+----------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+----------------+-----------+---------------------+
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 |
|
||||
+-----------+----------------+-----------+---------------------+
|
||||
2 rows in set (0.00 sec)
|
||||
`
|
||||
```text
|
||||
+-----------+----------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+----------------+-----------+---------------------+
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 |
|
||||
+-----------+----------------+-----------+---------------------+
|
||||
2 rows in set (0.00 sec)
|
||||
```
|
||||
|
||||
### السلسلة ليست في العمود
|
||||
|
||||
يمكنك وضع "NOT" قبل LIKE لاستبعاد الصفوف بنمط السلسلة بدلاً من تحديدها. يستثني هذا SQL السجلات التي تحتوي على "cer Pau" و "Ted" في العمود FullName.
|
||||
|
||||
`SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE FullName NOT LIKE '%cer Pau%' AND FullName NOT LIKE '%"Ted"%';
|
||||
`
|
||||
```sql
|
||||
SELECT studentID, FullName, sat_score, rcd_updated
|
||||
FROM student
|
||||
WHERE FullName NOT LIKE '%cer Pau%' AND FullName NOT LIKE '%"Ted"%';
|
||||
```
|
||||
|
||||
`+-----------+----------------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+----------------------+-----------+---------------------+
|
||||
| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 |
|
||||
| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 |
|
||||
| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 |
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 |
|
||||
| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 |
|
||||
| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 |
|
||||
+-----------+----------------------+-----------+---------------------+
|
||||
7 rows in set (0.00 sec)
|
||||
`
|
||||
```text
|
||||
+-----------+----------------------+-----------+---------------------+
|
||||
| studentID | FullName | sat_score | rcd_updated |
|
||||
+-----------+----------------------+-----------+---------------------+
|
||||
| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 |
|
||||
| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 |
|
||||
| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 |
|
||||
| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 |
|
||||
| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 |
|
||||
| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 |
|
||||
| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 |
|
||||
+-----------+----------------------+-----------+---------------------+
|
||||
7 rows in set (0.00 sec)
|
||||
```
|
||||
|
||||
_في ما يلي قائمة الطلاب الكاملة الحالية للمقارنة مع مكان تعيين نتيجة الجملة أعلاه._
|
||||
|
||||
`SELECT studentID, FullName, sat_score, rcd_updated FROM student;
|
||||
`
|
||||
```sql
|
||||
SELECT studentID, FullName, sat_score, rcd_updated FROM student;
|
||||
```
|
||||
|
||||
\`\` \`النص + ----------- + ------------------------ + ----------- + --------------------- + | studentID | FullName | _درجة_ جلس _|_ تحديث _Rcd_ | + ----------- + ------------------------ + ----------- + --------------------- + | 1 | مونيك ديفيز 400 | 2017-08-16 15:34:50 | | 2 | تيري جوتيريز | 800 | 2017-08-16 15:34:50 | | 3 | سبنسر باوتير | 1000 | 2017-08-16 15:34:50 | | 4 | لويس رمزي 1200 | 2017-08-16 15:34:50 | | 5 | ألفين غرين | 1200 | 2017-08-16 15:34:50 | | 6 | صوفي فريمان 1200 | 2017-08-16 15:34:50 | | 7 | إدغار فرانك "تيد" كود 2400 | 2017-08-16 15:35:33 | | 8 | دونالد د. شامبرلين 2400 | 2017-08-16 15:35:33 | | 9 | ريمون ف. بويس 2400 | 2017-08-16 15:35:33 | + ----------- + ------------------------ + ----------- + --------------------- + 9 صفوف في مجموعة (0.00 ثانية)
|
||||
Reference in New Issue
Block a user