home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,160 of 19,505   
   Tony Johansson to All   
   Re: How to I select to show only those t   
   08 Feb 15 10:03:01   
   
   From: johansson.andersson@telia.com   
      
   "Tony Johansson"  skrev i meddelandet   
   news:mb78g2$a0p$1@dont-email.me...   
   >   
   >   
   >> One Rider can own many Horses but one Horse can only be owned by one   
   >> Rider.   
   > The Rider Table have these columns SocSecNr, Name, Phone, E-mail, A path   
   > to an image, Description.   
   Primary key is SocSecNr   
      
   > The Horse have these columns Id, Name, A path to an image, Description   
   Primary key is Id   
      
   >> This query list all the relation between a Rider and a Horse.   
   >>   
   >> select Rider.Namn, Horse.Namn as Horsename   
   >> from Rider, Horse   
   >> where Horse.RiderID= Rider.SocSecNr   
   >> order by Rider.Namn   
   >>   
   >> Name                      Horsename   
   >> Adeline Falk           Vilja F   
   >> Anna Westman         Solidago   
   >> Anna Westman         early morning grey   
   >> Corola Häggqvist     Com-on Landlyst   
   >> Emil Olsson             Thea   
   >> Emil Olsson             Innocentia   
   >> Fantomen                 Fighter   
   >> Natalie Adelborg     Femerick   
   >> Sanna Johansson     Karavella   
   >> Sara Ignberg          Trisdan   
   >> Stålmannan             Marshall   
   >> Stålmannan             Oliver   
   >> Sven Tumba             Rasmus   
   >> Sven Tumba             Lukan   
   >>   
   >> How do I change this query if I only want to list those that have more   
   >> then one horse.   
   >> So the result from the query should be this.   
   >>   
   >> So the result would be   
   >> Anna Westman         Solidago   
   >> Anna Westman         early morning grey   
   >> Emil Olsson             Thea   
   >> Emil Olsson             Innocentia   
   >> Stålmannan             Marshall   
   >> Stålmannan             Oliver   
   >> Sven Tumba             Rasmus   
   >> Sven Tumba             Lukan   
   >>   
   >> //Tony   
   >>   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca