Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. How do you define "first".
  2. You should be able to run TRUNCATE on a cron -- or use the 5.1 event scheudler.
  3. But you're counting FixID in your other query....
  4. In fact, I'm not sure why you have the group by there at all... and it looks like you're missing a join condition.
  5. Sounds like you're using a group by and retrieving non- group-by columns...
  6. Say again?
  7. fenway

    SUM Function

    Sounds like you need to alias that exrpession.
  8. Explain that again...
  9. There's always another way....
  10. If you want to ignore the timestamp, then presumably it doesn't matter at all... so why not just drop it?
  11. This will return all the members who aren't already friend-ed: select friendid from members as m left join added as a on ( a.theirs = m.friendid ) where a.theirs is null Obviously, you'll need to limit it the current member....
  12. Well, you'll need to group by char (terrible column name, btw), and figure out what the first two are.
  13. I mean using the ID of the current one (which always exists) as a starting point, using LIMIT 5, and the ordering by something meaningful (_not_ the ID) in either DESC or ASC.
  14. Hmmm... could you show me the output of those 12 rows/
  15. Why not simply pass the current "position" and get the next/prev 5?
  16. Like I said, they're always going to be the same. You could try a COUNT( DISTINCT yourField).
  17. I'm not sure how you mean -- you're inner joining, so there will be the same # of records from both tables, and as long as the card field is NOT NULL, the counts will match.
  18. Not sure... but why would you need it to? Just paste the SQL statement directly...
  19. SHOW VARIABLES and SHOW STATUS are your friends.
  20. The extra % doesn't do anything, as you've discovered. But I don't think it's "greedy".
  21. You mean an UPDATE statement?
  22. 1. Yes, and it's often a good idea, since webservers and databases have opposite load requirements. 2. Assuming the box isn't too far away and is equally reliable, no. 3. It shouldn't. 4. I suppose.
  23. Yes, the 3rd query is now fine. The 2nd is a mess -- I asked for the explanation of the desired output of the query. What are you trying to achieve? NOT IN is terrible for index usage.
  24. You want: SELECT DISTINCT MANUFACTURERS_NAME FROM ( SELECT MANUFACTURERS_NAME FROM webwired_dropshipdirect.apparel UNION SELECT MANUFACTURERS_NAME FROM webwired_dropshipdirect.arts_crafts etc... )
  25. What output to do you want? You're currently joining 11 tables without a join condition... which makes me think you want a UNION.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.