MS SQL Return 1 Row Per Boat

Posted by Tyler on Stack Overflow See other posts from Stack Overflow or by Tyler
Published on 2010-04-29T05:45:01Z Indexed on 2010/04/29 5:47 UTC
Read the original article Hit count: 438

Filed under:
|
|

Basically, what I want to do is join 4 tables together and return 1 row for each boat.

Table Layouts

[Boats] id, date, section, raft

[Photos] id, boatid, pthurl, purl

[River_Company] id, sort, company, company_short

[River_Section] id, section

Its very simple as far as structure, however, I've having the time of my life trying to get it to return only 1 row. No boat will ever be on the same day, the only thing that's messing this up is the photo table.

If you know a better way for it to return the record table for all the boats boats and only 1 photo from the photo table, please, please post it!!

© Stack Overflow or respective owner

Related posts about sql

Related posts about column