// Get one random row that is female with a picture
select top 1 *
from table
where (gender = female) and (photo IS NOT NULL)
order by NewID()


On 12/7/05, Mike Belcher
<[EMAIL PROTECTED]> wrote:
> Okay that's easy............... thanks.
>
> I could get the latest 2 by doing:
>
> select top 2 * from table where gender = female order by inserDate DESC
>
> cool
>
>
> How would you get one of them at random? Out of all the femailse with photos
> would you go about selecting 1 at random out of the list?
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Minond
> Sent: Wednesday, December 07, 2005 6:33 AM
> To: [email protected]
> Subject: Re: [AspNetAnyQuestionIsOk] Sql query.
>
> select top 1 * from table where gender = female order by inserDate DESC
>
> On 12/7/05, Mike Belcher
> <[EMAIL PROTECTED]> wrote:
> > I though tI would toss this out in case anyone had a better way. What I
> want
> > to do is display the newest female member of the sight that has uploaded a
> > photo on the frontpage. This would change each time new ones join.
> Basically
> > I guess I would do a select * where gender = female and there is a
> > photo............ Order by deSC to put the new ones at the top and then
> take
> > the top one off with a reader I guess. That's about as far as I thought
> > about it. Just tossing it out to see if there are any ideas on a good way
> to
> > do this...........
> >
> >
> >
> > Mike
> >
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
AIDS in India: A "lurking bomb." Click and help stop AIDS now.
http://us.click.yahoo.com/VpTY2A/lzNLAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to