> I have 2 tables used for an online calendar...
>
> first table fields: primary_key , start_date, event_name,
> event_description
> second table fields: primary_key, end_date
>
> Tables fields are shortened and can't be changed.
>
> My second table only contains events that have a end date. I want
> to create
> a query that will take all the fields in. If no end_date exists
> then set to
> NULL. Been playing with it all day. Hoping some advance function exists. I
> thought of using a temp table but there must be a better way.
>

I am confused by your question.  It think it is missing words.  If you are
trying to select all records from first_table that do not have a record in
second_table you can use a left join and is null...

SELECT * from first_table LEFT JOIN second_table USING (primary_key) WHERE
second_table.primary_key IS NULL


Maybe I'm missing something here, but I don't see why you would want to
split your tables up that way.  You can't be saving that much room, and I
don't think it really goes with standard normalization conventions.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to