Table 1
Code: Select all
CREATE TABLE `gha_files_sections` (
`id` int(10) NOT NULL auto_increment,
`section_name` varchar(255) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1Code: Select all
CREATE TABLE `gha_files_subsections` (
`id` int(2) NOT NULL auto_increment,
`subsection_name` varchar(255) default NULL,
`cid` int(2) default NULL,
`order` int(2) default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1Code: Select all
SELECT s.id, s.section_name, ss.cid, ss.subsection_name
FROM ghaintranet.gha_files_sections AS s, ghaintranet.gha_files_subsections AS ss
WHERE (ss.cid = s.id) OR (s.id = 1)Is there some way i can do the query above, but modify it to add main sections that dont have a subsection!?
Or, will i have to have 2 querys?