“Sub columns” in MySQL

2019-08-31 04:59发布

问题:

I have a project idea which would be much more simple if this exists; Is it possible to create sub-columns in MySQL?

This is an example of what I mean, in table form:

+--------+---------------+
|        |    Weekday    |
|  Time  +-------+-------+
|        |  1ST  |  2ND  |
+--------+-------+-------+
| 8:00   | Jim   | Bob   |
| 9:00   | Steve | Jim   |
| 10:00  | Tod   | Rick  |
+--------+-------+-------+

I have to specify a primary and a secondary point of contact for every day of the week. I figured it would be very easy to have "Primary" and "Secondary" under Sunday, Saturday, etc.

A friend of mine suggested something like this would be possible, which led me to this quest.

回答1:

First think first that all of databases goal is about storing and manipulating data, whatever the type of database. And how data to be shown to user will be done on application level. On application level, data can be shown as table, grid, chart, or whatever you want.

I think you miss conception about this goal.