Current location: Hot Scripts Forums » Programming Languages » PHP » select timestamp that doesn't exist in other table


select timestamp that doesn't exist in other table

Reply
  #1 (permalink)  
Old 03-12-04, 08:40 AM
jove jove is offline
New Member
 
Join Date: Mar 2004
Location: the Netherlands
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question select timestamp that doesn't exist in other table

Some of you probably know this trick to select rows from one table with an ID value that doesn't exist in another table:

mysql> SELECT table1.* FROM table1
-> LEFT JOIN table2 ON table1.id=table2.id
-> WHERE table2.id IS NULL;

But now take look at this particular situation:

CREATE TABLE `table1` (
`id` int(11) NOT NULL auto_increment,
`data` varchar(255) NOT NULL default '',
`created` timestamp(14),
PRIMARY KEY (`id`)
);

Same goes for table 2.
Now this is my problem: how can i select rows from table 1 with a timestamp `created` that doesn't exist in table 2? the IS NULL trick doesn't seem to work. I guess that is because a timestamp can never be null.

Thanx in advance!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto table resize derick_2k JavaScript 4 04-26-04 02:32 PM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM
strange grey "extra" table area... skyraider HTML/XHTML/XML 1 12-10-03 10:55 PM
i have 3 select box this is urgent traceMe JavaScript 0 12-02-03 01:24 AM
moving data from table to table ..please help! geneane ASP 2 09-22-03 07:02 PM


All times are GMT -5. The time now is 10:19 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.