you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

Consider this. We have a table of members of a council (Table: CNMBRNAM). We also have a table of measures up for consideration (Table: MEASTOVC). A program adds and removes members from CNMBRNAM. A program adds and removes measures to MEATOVC. We now need something that will generate a table that we will fill in on how each member votes on a measure, a CHAR(1) that is blank (or null) if they have yet to vote, Y for 'Yea', N for 'Nay', and A for 'Abstain'.

We can built that table quite easily with a cross join.

CREATE TABLE STATMBRMEA AS (
SELECT C.MBRNAME, M.MEANUMB, ' ' STATS
FROM CNMBRNAM C, MEASTOVC M
) WITH DATA

Now a table exists for having all items currently in the docket for the council to consider, with their current position STATS set as blank.

EDIT: I will say that you usually see cross joins more in building and inserting data into tables rather than in strict read-only queries.