I have three following tables. The relationship is that each report_param and report_frequency is tied together using the intermediate table report_freq_map. Is it possible to construct an SQL so that user can select all the report_param rows using the constraint like frequency='daily', instead of using frequency='1'.
Thanks, -peter
mysql> describe report_params;
+---------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| test_level | varchar(45) | NO | | NULL | |
| sequence_name | varchar(45) | NO | | NULL | |
| step_name | varchar(45) | NO | | NULL | |
| descriptions | text | NO | | NULL | |
+---------------+------------------+------+-----+---------+----------------+
mysql> describe report_frequency;
+-----------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| frequency | varchar(25) | YES | | NULL | |
+-----------+------------------+------+-----+---------+----------------+
mysql> describe report_freq_map;
+-----------+---------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| report_id | int(11) | NO | PRI | 0 | |
| freq_id | int(11) | NO | PRI | 0 | |
+-----------+---------+------+-----+---------+-------+