Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

SQL query - please help!

 
   Database Forums (Home) -> PHP SQL RSS
Next:  Encoding conversion problem  
Author Message
bart3r

External


Since: Feb 10, 2008
Posts: 2



(Msg. 1) Posted: Sun Feb 10, 2008 8:55 pm
Post subject: SQL query - please help!
Archived from groups: alt>php>sql (more info?)

Hello,

I have a table of transactions for users.

I want to return the last transaction for each user. What would the
mysql statement be?
What if i wanted to return the last 3 transactions for each user?

Any help would be great.
Thanks.
Andrew.

 >> Stay informed about: SQL query - please help! 
Back to top
Login to vote
Captain Paralytic

External


Since: Apr 23, 2007
Posts: 89



(Msg. 2) Posted: Mon Feb 11, 2008 1:56 am
Post subject: Re: SQL query - please help! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 11 Feb, 04:55, bart3r wrote:
> Hello,
>
> I have a table of transactions for users.
>
> I want to return the last transaction for each user. What would the
> mysql statement be?
> What if i wanted to return the last 3 transactions for each user?
>
> Any help would be great.
> Thanks.
> Andrew.

I suggest you ask this on comp.databases.mysql

 >> Stay informed about: SQL query - please help! 
Back to top
Login to vote
vbasic55

External


Since: Feb 11, 2008
Posts: 4



(Msg. 3) Posted: Mon Feb 11, 2008 11:06 pm
Post subject: Re: SQL query - please help! [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Just messed up on my answer - should have indicated ORDER BY DESC, not ASC.
Sorry about that.

V


"bart3r" wrote in message

> Hello,
>
> I have a table of transactions for users.
>
> I want to return the last transaction for each user. What would the
> mysql statement be?
> What if i wanted to return the last 3 transactions for each user?
>
> Any help would be great.
> Thanks.
> Andrew.
 >> Stay informed about: SQL query - please help! 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Help with SQL query? - I have a table in which the records a bunch of fields; for this query, I'm interested in three of them - let's call them Fld1, Fld2 and Fld3. For each record in the table, these fields may or may not contain data (a stock ticker symbol - like MSFT, for..

Help with a Query - Hi there I'm trying to work out how to run a query that checks if there are duplicated records in a table and then have to run a query to delete them (need to check if there are an duplicates before I delete them) the 3 fields to use as the test would....

sql query - This code works perfecty on mysql 4.1 bun my hosting is on mysql4.0. silly me Problem is on NOT IN SELECT hotel.hotel, hotel.hotelid, hotel.price, hotel.star, place.place FROM hotel left join region on hotel.idregion = region.idregion left join..

Help with query - I want to search the database for users who have email addresses whose email username matches their stored username. So assuming my table is like so: TABLE `users` id | username | email 1 | jim | user@domain.com 2 | bob | bob@domain.com 3 | jen |..

help with query - Hi guys, I'm having some trouble getting a query to return the information I require. Tables: EventMaster holds the venue details Event holds the date of the event and some other irrelevant information, linked to EventMaster by EventMasterID Results hold...
   Database Forums (Home) -> PHP SQL All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]