Ask a Question related to Dreamweaver AppDev, Design and Development.
-
ossie #1
Distinct records only
Hi
I'm building a gallery app in vb.net with sql2000 and am sort of stuck so
any advice would be gratefully received, heres the trouble
I have a user control that displays latest photos populated from an SP
(Select iFilename, iDate, iUserID from tblImages order by iDate Desc)
works like a charm however if a user uploads 5 photos all the latest photos
on the homepage will be theirs. I'd like to only retrieve only records with
a unique userID
I tried
Select distinct iUserID iFilename, iDate, from tblImages order by iDate Desc
but it didn't work, I tried google but didn't find anything similar and a
few others that only retrieved totally unique records.
I'm up against a deadline and this is the last bit so any advice gratefully
received
ossie Guest
-
SQL Distinct
I want to select distinct value from one field of the table and select rest of the corresponding fields accordingly. I have a table that has fields:... -
need help on DISTINCT
Hi ALl, I need some help on DISTINCT in a query I'm trying to run. I have two tables which are linked. This is the query I use: SQL = "SELECT... -
return distinct
Is this what you are looking for.(check the group by clause) SELECT TOP 100 PERCENT dbo.tbl_purchase_order_lines.stock_code,... -
SELECT DISTINCT + ORDER BY gives ERROR 145: ORDER BY items must appear in the select list if SELECT DISTINCT is specified.
Following is my stored procedure. If I take the DISTINCT out then everything works fine. BUT I need the distinct because it returns duplicate... -
SELECT DISTINCT + ORDER BY gives ERROR 145: ORDER BY items mustappear in the select list if SELECT DISTINCT is specified.
Dan, You should be able to do this: SELECT Id, FaxID, ReceivedTime, Pages FROM ( SELECT DISTINCT .Id AS Id, -
Paul Whitham TMM #2
Re: Distinct records only
The problem with Distinct is that it works against the whole line of code
and with the file name being specified then it will never limit itself on
the userid alone.
You could try creating two queries to loop through a list of distinct ID,
however a simple method may be to use some conditional login on the page to
only display a second image if the UserID assocuated with in is not the same
as the first.
--
Regards
Paul Whitham
Macromedia Certified Professional for Dreamweaver MX2004
Valleybiz Internet Design
[url]www.valleybiz.net[/url]
Team Macromedia Volunteer for Ultradev/Dreamweaver MX
[url]www.macromedia.com/support/forums/team_macromedia[/url]
"ossie" <forums@microsoft.com> wrote in message
news:cvf9k4$olb$1@forums.macromedia.com...photos> Hi
>
> I'm building a gallery app in vb.net with sql2000 and am sort of stuck so
> any advice would be gratefully received, heres the trouble
> I have a user control that displays latest photos populated from an SP
> (Select iFilename, iDate, iUserID from tblImages order by iDate Desc)
> works like a charm however if a user uploads 5 photos all the latestwith> on the homepage will be theirs. I'd like to only retrieve only recordsDesc> a unique userID
>
> I tried
> Select distinct iUserID iFilename, iDate, from tblImages order by iDategratefully>
> but it didn't work, I tried google but didn't find anything similar and a
> few others that only retrieved totally unique records.
>
> I'm up against a deadline and this is the last bit so any advice> received
>
>
Paul Whitham TMM Guest



Reply With Quote

