Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. [09:51] <@Eebs> lemme try to explain this better
  2. [09:52] <@Eebs> id, itemID, date
  3. [09:52] <motstandet> just tell me your scheme
  4. [09:52] <@Eebs> id is the primary key
  5. [09:52] <@Eebs> there are other fields, but not relevent atm
  6. [09:52] <@Eebs> so, I'm trying to find out the ids, of all items
  7. [09:52] <@Eebs> that were inserted most recently
  8. [09:52] <@Eebs> so if I group by itemID, it returns id 1 and 2
  9. [09:53] <@Eebs> which are the correct itemIDs, but the first rows inserted
  10. [09:53] <@Eebs> order by only affects the resulting set
  11. [09:53] <motstandet> you want items that were most recently added?
  12. [09:53] <@Eebs> so it just orders 1 and 2
  13. [09:53] <motstandet> just order by date desc and limit 10 or something
  14. [09:54] <@Eebs> but there could be 50 different items
  15. [09:54] <@Eebs> so I can't use limit
  16. [09:54] <motstandet> you just said you wanted recently added
  17. [09:54] <motstandet> how recent
  18. [09:54] <@Eebs> the most recent
  19. [09:54] <@Eebs> lol
  20. [09:54] <motstandet> what does that mean
  21. [09:54] <motstandet> today?
  22. [09:54] <@Eebs> the rows are inserted every hour by a script
  23. [09:55] <@Eebs> but i can't count on that
  24. [09:55] <motstandet> the most recent item added would be the first item in the date-sorted table
  25. [09:55] <@Eebs> they are done this way
  26. [09:55] <@Eebs> so I can have an idea of the change over time
  27. [09:55] <Dinosaurs> mots i get the feeling oyu think this is more simple than it is
  28. [09:55] <@Eebs> this is a database of POSes
  29. [09:55] <@Eebs> well, table of POSes
  30. [09:55] <@Eebs> I am querying the EVE database, getting fuel levels every hour
  31. [09:56] <@Eebs> I need to display the most recent fuel levels
  32. [09:56] <sunk> cookies
  33. [09:56] <@Eebs> there are multiple POSes in the table
  34. [09:56] <@Eebs> hence, multiple itemIDs
  35. [09:56] <motstandet> so you want the most recent entry FOR EACH pos?
  36. [09:56] <@Eebs> yeah
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement