I am trying to access some data on a slurm MySQL database. The table linux_job_table
has the following columns:
+--------------------+---------------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+--------------------+---------------------+------+-----+------------+----------------+
| job_db_inx | bigint(20) unsigned | NO | PRI | NULL | auto_increment |
| mod_time | bigint(20) unsigned | NO | | 0 | |
| deleted | tinyint(4) | NO | | 0 | |
| account | tinytext | YES | | NULL | |
| admin_comment | text | YES | | NULL | |
| array_task_str | text | YES | | NULL | |
| array_max_tasks | int(10) unsigned | NO | | 0 | |
| array_task_pending | int(10) unsigned | NO | | 0 | |
| constraints | text | YES | | NULL | |
| cpus_req | int(10) unsigned | NO | | NULL | |
| derived_ec | int(10) unsigned | NO | | 0 | |
| derived_es | text | YES | | NULL | |
| exit_code | int(10) unsigned | NO | | 0 | |
| flags | int(10) unsigned | NO | | 0 | |
| job_name | tinytext | NO | | NULL | |
| id_assoc | int(10) unsigned | NO | MUL | NULL | |
| id_array_job | int(10) unsigned | NO | MUL | 0 | |
| id_array_task | int(10) unsigned | NO | | 4294967294 | |
| id_block | tinytext | YES | | NULL | |
| id_job | int(10) unsigned | NO | MUL | NULL | |
| id_qos | int(10) unsigned | NO | MUL | 0 | |
| id_resv | int(10) unsigned | NO | MUL | NULL | |
| id_wckey | int(10) unsigned | NO | MUL | NULL | |
| id_user | int(10) unsigned | NO | MUL | NULL | |
| id_group | int(10) unsigned | NO | | NULL | |
| pack_job_id | int(10) unsigned | NO | MUL | NULL | |
| pack_job_offset | int(10) unsigned | NO | | NULL | |
| kill_requid | int(11) | NO | | -1 | |
| state_reason_prev | int(10) unsigned | NO | | NULL | |
| mcs_label | tinytext | YES | | NULL | |
| mem_req | bigint(20) unsigned | NO | | 0 | |
| nodelist | text | YES | | NULL | |
| nodes_alloc | int(10) unsigned | NO | MUL | NULL | |
| node_inx | text | YES | | NULL | |
| partition | tinytext | NO | | NULL | |
| priority | int(10) unsigned | NO | | NULL | |
| state | int(10) unsigned | NO | | NULL | |
| timelimit | int(10) unsigned | NO | | 0 | |
| time_submit | bigint(20) unsigned | NO | | 0 | |
| time_eligible | bigint(20) unsigned | NO | MUL | 0 | |
| time_start | bigint(20) unsigned | NO | | 0 | |
| time_end | bigint(20) unsigned | NO | MUL | 0 | |
| time_suspended | bigint(20) unsigned | NO | | 0 | |
| gres_req | text | NO | | NULL | |
| gres_alloc | text | NO | | NULL | |
| gres_used | text | NO | | NULL | |
| wckey | tinytext | NO | | NULL | |
| work_dir | text | NO | | NULL | |
| system_comment | text | YES | | NULL | |
| track_steps | tinyint(4) | NO | | NULL | |
| tres_alloc | text | NO | | NULL | |
| tres_req | text | NO | | NULL | |
+--------------------+---------------------+------+-----+------------+----------------+
but when i do:
SELECT partition from linux_job_table
I get the following error:
`ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'partition from linux_job_table' at line 1`
But the same command works for all the other column headers:
mysql> SELECT id_job from linux_job_table;
+--------+
| id_job |
+--------+
| 2 |
+--------+
1 row in set (0.00 sec)
Can anyone explain what might be causing this error?
PARTITION
is a reserved word. Enclose it in backticks.
SELECT `partition`
FROM linux_job_table;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.