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 Administration
 No output. Just Column Names.

Author  Topic 

dlmagers10
Starting Member

48 Posts

Posted - 2010-12-06 : 14:55:24
select marina_slip.marina_num, marina_slip.slip_num, marina_slip.boat_name, owner.city, marina_slip.boat_type
from marina_slip, owner
where city = ANY
(select boat_name
from marina_slip
where marina_slip.boat_name = 'Sprite 4000');

Why would I not have any thing in my columns. No output. Just Column Names.

Diana Magers

*There is no formula for success except perhaps an unconditional acceptance of life and what it brings.

dlmagers10
Starting Member

48 Posts

Posted - 2010-12-06 : 15:13:33
I need to join these tables. Right?

Diana Magers

*There is no formula for success except perhaps an unconditional acceptance of life and what it brings.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-12-06 : 15:13:44
Probably because you don't have any boats named after cities.
Go to Top of Page

dlmagers10
Starting Member

48 Posts

Posted - 2010-12-06 : 15:18:29
I thought in the where clause for ALL or ANY you have a column name and either equal or lesser than or greater than.

I am looking for the city of 'Glander Bay'

Diana Magers

*There is no formula for success except perhaps an unconditional acceptance of life and what it brings.
Go to Top of Page

dlmagers10
Starting Member

48 Posts

Posted - 2010-12-06 : 15:20:21
If I put 'Glander Bay' in with the city then the output gives me two table output.

Diana Magers

*There is no formula for success except perhaps an unconditional acceptance of life and what it brings.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2010-12-06 : 15:57:29
quote:
I thought in the where clause for ALL or ANY you have a column name and either equal or lesser than or greater than.
Since you're using equals, you're asking the query the match a city that equals the boat name returned in the subquery (which is Sprite 4000).
Go to Top of Page
   

- Advertisement -