Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [09:51] <@Eebs> lemme try to explain this better
- [09:52] <@Eebs> id, itemID, date
- [09:52] <motstandet> just tell me your scheme
- [09:52] <@Eebs> id is the primary key
- [09:52] <@Eebs> there are other fields, but not relevent atm
- [09:52] <@Eebs> so, I'm trying to find out the ids, of all items
- [09:52] <@Eebs> that were inserted most recently
- [09:52] <@Eebs> so if I group by itemID, it returns id 1 and 2
- [09:53] <@Eebs> which are the correct itemIDs, but the first rows inserted
- [09:53] <@Eebs> order by only affects the resulting set
- [09:53] <motstandet> you want items that were most recently added?
- [09:53] <@Eebs> so it just orders 1 and 2
- [09:53] <motstandet> just order by date desc and limit 10 or something
- [09:54] <@Eebs> but there could be 50 different items
- [09:54] <@Eebs> so I can't use limit
- [09:54] <motstandet> you just said you wanted recently added
- [09:54] <motstandet> how recent
- [09:54] <@Eebs> the most recent
- [09:54] <@Eebs> lol
- [09:54] <motstandet> what does that mean
- [09:54] <motstandet> today?
- [09:54] <@Eebs> the rows are inserted every hour by a script
- [09:55] <@Eebs> but i can't count on that
- [09:55] <motstandet> the most recent item added would be the first item in the date-sorted table
- [09:55] <@Eebs> they are done this way
- [09:55] <@Eebs> so I can have an idea of the change over time
- [09:55] <Dinosaurs> mots i get the feeling oyu think this is more simple than it is
- [09:55] <@Eebs> this is a database of POSes
- [09:55] <@Eebs> well, table of POSes
- [09:55] <@Eebs> I am querying the EVE database, getting fuel levels every hour
- [09:56] <@Eebs> I need to display the most recent fuel levels
- [09:56] <sunk> cookies
- [09:56] <@Eebs> there are multiple POSes in the table
- [09:56] <@Eebs> hence, multiple itemIDs
- [09:56] <motstandet> so you want the most recent entry FOR EACH pos?
- [09:56] <@Eebs> yeah
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement