If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Problem using joins.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-24-04, 10:27
joydip_kanjilal joydip_kanjilal is offline
Registered User
 
Join Date: Feb 2004
Posts: 21
Problem using joins.

Please refer to the following table structure.

stationDate date
staffID varchar(12)

I want top display the records from this table for the last date prior to a station date specified.


Suppose the table contains the following records:---


Staff ID Station Date

1 2004-05-17
2 2004-05-18
3 2004-05-19
2 2004-05-19
1 2004-05-15


If the input date is '2004-05-20' then the output should be :---

Staff ID Station Date

3 2004-05-19
2 2004-05-19

Please use only one query statement using joins in MYSQL. Please do not create any temp tables.

Thanx in advance.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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