Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 two queries in one statment with different results

Author  Topic 

addo
Starting Member

3 Posts

Posted - 2012-10-31 : 07:20:50
Hey ever1 one out there!

im trying to get two almost same quarries for expect one different value, which is job status (its either vacant or occupied! look further in the screen shots and you will understand!

and the actuall table is


Thanks heaps for the help!!!

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2012-10-31 : 07:30:45
Can't see the screen shots - can you post the sql.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

addo
Starting Member

3 Posts

Posted - 2012-10-31 : 07:36:31
heres the query

select j.jobid,j.jobdesc,s.stafffname,s.stafflname,j.status,j.startdatetime,v.venuename
from job j,venue v,staff s
where (j.status='occupied' and j.staffid=s.staffid and j.venueid=v.venueid
and j.staffid=s.staffid and j.dateenlisted='2012-10-25')
or (j.status='vaccant' and j.staffid=null)
;

http://s18.postimage.org/ejwlf5zhz/Capture.png
http://s12.postimage.org/61bivyfgb/Capture2.png
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-10-31 : 09:23:23
the links are blocked here. can you post them inline?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

addo
Starting Member

3 Posts

Posted - 2012-10-31 : 09:32:28
[url]http://s18.postimage.org/ejwlf5zhz/Capture.png[/url]
[url]http://postimage.org/image/hqfijx6ex/full/[/url]

Sorry for all the delays caused here!
Go to Top of Page
   

- Advertisement -