Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. OMG... can you actually understand any of your own code? No offense, but that's brutal.
  2. You almost never want DISTINCT... it's just lazy, and 99.999% of the time it's completely wrong, and returned seemingly correct results by accident. I also ever use it in "UNION DISTINCT", where it actually makes sense.
  3. Well, I assume your got this calendar from somewhere... they obviously have docs for login config.
  4. So, what was it?
  5. I already gave you the answer... you need to get the names of the columns first.
  6. You can't use column aliases *during* a query... SELECT CC.num1 AS mytotal1, CD.num2 AS mytotal2, c.id, c.name, (mytotal1-mytotal2) AS difference needs to be SELECT CC.num1 AS mytotal1, CD.num2 AS mytotal2, c.id, c.name, (CC.num1-CD.num2) AS difference
  7. Yes, OR is slow.. maybe index_merge will help.
  8. fenway

    help?

    Then use DATE_FORMAT(). And CURDATE()+1 is pure evil, use CURDATE()+INTERVAL 1 DAY.
  9. This seems awfully similar to your other topic... what's different here
  10. A derived table would work too.
  11. I assumed your already tried a blank password....
  12. Why not SELECT topic_id, ( 6 - poll_option_id ) AS score, poll_option_total AS num_votes FROM phpbb_poll_options
  13. Mysql doesn't support capturing parens like php. I suppose you could be sneaky like this: UPDATE _testing set id = IF( LOCATE( REVERSE(', THE'), REVERSE(yourField) ) = 1 ,CONCAT( 'THE ', REVERSE( SUBSTRING( REVERSE(yourField), LOCATE( REVERSE(', THE'), REVERSE(yourField) )+length(', THE') ) ) ) ,yourField )
  14. First you need to get "each" employee -- then you can find the last row.
  15. Actually, I think you mean: SELECT o.offerid , o.name, o.incent, o.type, o.reporting, o.category , IFNULL( e.pay_value, o.pay_value ) AS payValue FROM offers as o JOIN exceptions as e USING (pay_value,offerid) WHERE o.status = 'On' ORDER BY payValue $orderx LIMIT $from, $max_results
  16. Then replace "DELETE FROM" with "SELECT *", or something equivalent.
  17. I prefer: SELECT e_ticketbuyer.* , events.title, events.date, events.city, events.country FROM e_ticketbuyer INNER JOIN events USING ( e_id ) About the "differ" question, the e_id values are the same, by definition, so I'm not sure I understand. The table prefixes do not make it into the field names.
  18. What does "CHECK TABLES" say?
  19. That's why it's not working -- redirection on the command-line will not deal with UTF8 properly; use the -r filename option instead.
  20. The link I posted earlier has all of the details.
  21. Do your echo statements produce the expected tuples in the outptu?
  22. So you don't want the actual results of the search?
  23. fenway

    Mysql query

    There are fields in your example output that don't show up from your query. First hint -- drop DISTINCT.
  24. Please share the details of your solution before marking it "solved".
  25. Well, it has to be somehwere.
×
×
  • 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.