Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 08-07-2007, 10:43 PM SQL Problems
Average Talker

Posts: 24
Trades: 0
Hello,

I have a query which needs to pull the just the row ID from a table, but the row must meet certain requirements. The information is in 3 tables, linked by IDs, ssid, aid and TID are the ones I used in the query.. the other table just uses ID.

Here is the query:
Code:
SELECT si.id 
FROM 
  trucks t, 
  service_sheets ss, 
  service_info si 
WHERE ss.ssid=si.ssid 
AND t.tid=si.tid
AND ss.aid=1
AND t.aid=1
AND date(ss.date)=date('07-02-2007')
AND si.hours=555
AND t.unit_num=123
AND si.mileage=88
The data in there is dummy data if you guys need to know what the table structure is let me know, I'm not very good with this complex SQL stuff.

Basically I want to pull the row id from the service_info table, in the service info table there is a service sheet id (ssid), which corresponds to the row in the service sheet table that this row belongs too. There is also a truck id (tid) that references the truck table so I can get the unit number.

Any help is greatly appreciated.

Thanks in advance!

FuZion
FuZion is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-08-2007, 04:08 AM Re: SQL Problems
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
:-D
So you're spreading it further !?



http://codingforums.com/showthread.php?t=120834

lol, caught ya !
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-08-2007, 11:42 AM Re: SQL Problems
Average Talker

Posts: 24
Trades: 0
Ha ya got me but hey a second opinion never hurts!
FuZion is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to SQL Problems
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.75626 seconds with 12 queries