Click here to Skip to main content
15,924,318 members
Home / Discussions / Database
   

Database

 
QuestionAccessing SQL Server 2005 using HTTP Pin
SSindhu9-Jan-07 18:41
SSindhu9-Jan-07 18:41 
QuestionStored procedure performance Pin
Rahithi9-Jan-07 18:09
Rahithi9-Jan-07 18:09 
AnswerRe: Stored procedure performance Pin
WoutL9-Jan-07 20:43
WoutL9-Jan-07 20:43 
QuestionNeed help with SQL query Pin
Christian Graus9-Jan-07 14:24
protectorChristian Graus9-Jan-07 14:24 
AnswerRe: Need help with SQL query Pin
Colin Angus Mackay9-Jan-07 22:52
Colin Angus Mackay9-Jan-07 22:52 
GeneralRe: Need help with SQL query Pin
Christian Graus9-Jan-07 23:31
protectorChristian Graus9-Jan-07 23:31 
GeneralRe: Need help with SQL query Pin
Colin Angus Mackay10-Jan-07 0:22
Colin Angus Mackay10-Jan-07 0:22 
QuestionNeed help with Sql Statement Pin
DMBFiredancer9-Jan-07 13:56
DMBFiredancer9-Jan-07 13:56 
I have 2 tables, a galleries table and a photos table...

I'm trying to select all the data from the galleries table and then JUST ONE row from the photos table based on the gallery_id that is the FK.

If I do the following:
<br />
SELECT     Galleries.Id, Galleries.Name, Galleries.Description, Photos.Id AS Expr1<br />
FROM         Galleries INNER JOIN<br />
                      Photos ON Galleries.Id = Photos.Gallery_Id<br />
WHERE     (Galleries.Visible = @Visible)<br />


I get rows returned with duplicate gallery information... So basically I want to know how i can get a single row of data for a each unique gallery.Id and add a single photo.id that matches that gallery_id...

I've messed around with distinct and still can't get it to work...

(Sql Server 2005 Express)

Thanks
AnswerRe: Need help with Sql Statement Pin
Mark J. Miller9-Jan-07 14:09
Mark J. Miller9-Jan-07 14:09 
GeneralRe: Need help with Sql Statement Pin
Mark J. Miller9-Jan-07 14:10
Mark J. Miller9-Jan-07 14:10 
GeneralRe: Need help with Sql Statement Pin
DMBFiredancer9-Jan-07 14:20
DMBFiredancer9-Jan-07 14:20 
QuestionDatabase Explorer Database Connection Pin
mfcuser9-Jan-07 10:02
mfcuser9-Jan-07 10:02 
AnswerRe: Database Explorer Database Connection Pin
Rob Graham9-Jan-07 11:53
Rob Graham9-Jan-07 11:53 
QuestionTable-value function performance Pin
kmaclean9-Jan-07 9:51
kmaclean9-Jan-07 9:51 
QuestionOpposite of the SQL "IN" statement? Pin
dspyank9-Jan-07 6:17
dspyank9-Jan-07 6:17 
QuestionRe: Opposite of the SQL "IN" statement? Pin
Chris Meech9-Jan-07 6:24
Chris Meech9-Jan-07 6:24 
AnswerRe: Opposite of the SQL "IN" statement? Pin
kmaclean9-Jan-07 11:32
kmaclean9-Jan-07 11:32 
AnswerRe: Opposite of the SQL "IN" statement? Pin
Saud AKhter16-Jan-07 20:22
Saud AKhter16-Jan-07 20:22 
QuestionProcedure with multiple parameters and multiple Select Statements Pin
rodney.fetterolf9-Jan-07 3:48
rodney.fetterolf9-Jan-07 3:48 
AnswerRe: Procedure with multiple parameters and multiple Select Statements Pin
andyharman9-Jan-07 5:29
professionalandyharman9-Jan-07 5:29 
AnswerRe: Procedure with multiple parameters and multiple Select Statements Pin
M.H.1.2.314-Jan-07 21:46
M.H.1.2.314-Jan-07 21:46 
QuestionWhat is "N" in OBJECTPROPERTY(id, N'IsUserTable') = 1) Pin
Nick1977_209-Jan-07 3:06
Nick1977_209-Jan-07 3:06 
AnswerRe: What is "N" in OBJECTPROPERTY(id, N'IsUserTable') = 1) Pin
Pete O'Hanlon9-Jan-07 3:36
mvePete O'Hanlon9-Jan-07 3:36 
GeneralRe: What is "N" in OBJECTPROPERTY(id, N'IsUserTable') = 1) Pin
Rob Graham9-Jan-07 3:46
Rob Graham9-Jan-07 3:46 
GeneralRe: What is "N" in OBJECTPROPERTY(id, N'IsUserTable') = 1) Pin
Pete O'Hanlon9-Jan-07 4:11
mvePete O'Hanlon9-Jan-07 4:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.