Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > select stmnt inside select stmnt

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-30-08, 00:30
homer.favenir homer.favenir is offline
Registered User
 
Join Date: Oct 2007
Location: Manila, Philippines
Posts: 95
select stmnt inside select stmnt

hi to all,
i would like to ask how to join two selects in one query?
Code:
SELECT tbl_transactions.artid, tbl_transactions.transcode, tbl_transactions.startedby, tbl_user.lastname, tbl_user.firstname, sec_to_time(sum(time_to_sec(timediff(dtecompleted,dtestarted)))) as 'Total Time Spent', (SELECT dtestarted FROM tbl_transactions where transcode = 'sh') as 'shipp date' FROM tbl_transactions inner join tbl_user on (tbl_transactions.startedby = tbl_user.userid) group by artid, transcode order by 'total time spent' desc

thanks!
__________________
Take Nothing But Pictures;
Leave Nothing But Footprints;
Kill Nothing But Time;
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

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