Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You can derive tables on the fly, yes
  2. I'm confused by your call to fetch_array() outsdie the while loop. But regardless, it sounds like you want GROUP_CONCAT().
  3. Well, since ASCII characters are one byte each....
  4. I don't undersatnd.
  5. That's basically all a normal user would need... unelss you use replace, which requires delete too
  6. STrictly speaking, you shouldn't have the name field in there....
  7. And what error do you get from runnign that insert statement?
  8. Why the correlated subquery? Why not just join in a dervied table of max update times?
  9. Says who?
  10. How about: SELECT e.emp_name FROM employee AS e INNER JOIN ( SELECT employee_no, COUNT(*) AS cnt FROM sales GROUP BY employee_no HAVING cnt = ( SELECT MAX(cnt) FROM ( SELECT COUNT(*) AS cnt FROM sales GROUP BY employee_no ) ) ) s ON ( s.employee_no=s.employee_no )
  11. Don't you mean UPDATE?
  12. Hmmm... what does the database field contains for such values with HTML entities?
  13. And you've used "SET NAMES" in your mysql connection from php, and defined everything else correctly w.r.t encoding/
  14. Is the database correct and the output wrong? or are both wrong?
  15. I'm not sure I understand... you have to specify the encoding of the connection, too.
  16. Apparently so.
  17. You still have to deal with the year issue... hence the previous thread.
  18. fenway

    sql help

    Don't double-post -- I already deleted a third thread of exactly the same topic.
  19. Does this help? You might as well use multiple queries... or subqueries if you prefer. SELECT COUNT(*) FROM .... WHERE serviceJob.dateReceived < CURDATE() - INTERVAL 10 DAY SELECT COUNT(*) FROM .... WHERE serviceJob.dateReceived BETWEEN CURDATE() - INTERVAL 10 DAY AND CURDATE() - INTERVAL 7 DAY SELECT COUNT(*) FROM .... WHERE serviceJob.dateReceived >= CURDATE() - INTERVAL 7 DAY
  20. There is an EXISTS query, too.
  21. Still not helpful... format that query nicely, please.... like on multiple lines.
  22. Shouldn't you be using: DELIMITER || CREATE FUNCTION calculaMedia (m1 FLOAT(2,6),m2 FLOAT(2,6)) RETURNS FLOAT(2,6) BEGIN DECLARE media FLOAT(2,6); SET media = (m1+m2)/2; RETURN media; END; || DELIMITER ;
×
×
  • 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.