I have tables as below and want to use SQL statement "select groups.id
as GroupID, groups.name as GroupName, views.id as ViewID, views.name as
ViewName, subviews.id as SubViewID, subviews.name as SubViewName from
groups,views,subviews,groups_views_subviews where groups.id =
groups_views_subviews.group_id and views.id =
groups_views_subviews.view_id and subviews.id =
groups_views_subviews.subview_id;" to join them inside the Group class,
however, I can't figure out how to do this.  I assume finderSql is what
I'm looking for, but I can't seem to make it work.

CREATE TABLE views (
  id MEDIUMINT AUTO_INCREMENT,
  name VARCHAR(50) NOT NULL,
  PRIMARY KEY(id)
);

CREATE TABLE groups_views_subviews (
  view_id MEDIUMINT,
  subview_id MEDIUMINT,
  group_id MEDIUMINT
);

CREATE TABLE subviews (
  id MEDIUMINT AUTO_INCREMENT,
  name VARCHAR(50) NOT NULL,
  PRIMARY KEY(id)
);

CREATE TABLE groups (
  id MEDIUMINT AUTO_INCREMENT,
  name VARCHAR(50) NOT NULL,
  PRIMARY KEY(id)
);


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to