Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. Depends what you're trying to do... INNER JOIN is better unless you want to retrieve posts that don't have matching categories/users.
  2. Have you issued a CHECK TABLES?
  3. I'm not sure I know what you mean... if you have the ID of the corresponding row, you can issue a DELETE statement for that ID.
  4. That's because modID is going to be null for everyone else, and null sorts differently.... if you use IFNULL() and set it to -1, ASC should be fine.
  5. Are you sure you've selected the right DB?
  6. Simply join the users and categories table to the posts table.
  7. With wildcards LIKE is the same as =.
  8. It's not different as much as it is unsupported. Try this (untested): SELECT DISTINCT order_number FROM orders INNER JOIN ordercart ON orders.order_number = ordercart.id INNER JOIN categories ON orders.product = categories.catid WHERE orders.confirmed =1 AND thedate = '2008-04-03' AND categories.designerid =9 I'm just guessing at tables here.
  9. DATE_FORMAT() always returns a string regardless... but the only reason to get an error like that with a subquery (i.e. at the SELECT keyword) is a version issue.
  10. Hmmm... we'll, I'd quote those string literals.
  11. Which db version?
  12. Don't... preprend this code for display only.
  13. Though I'd prefer a left join.
  14. What do you think the first operand to LEFT() is doing? You can't string concat that way.
  15. double-post -- topic locked.
  16. I don't know what you mean by "work"... this is simply a very big associated array.
  17. Can be used anywhere an expression is alid.
  18. You mean "WHERE col1 = CONCAT( col2, col3 )"?
  19. I mean this: SELECT count(student_answer.choice_No) 'counted', choice.choice_No 'no', choice.choice_Desc 'desc' FROM student_answer LEFT JOIN choice ON ( choice.choice_No = student_answer.choice_No AND choice.question_ID = '2') WHERE student_answer.question_ID = '2' and choice.choice_No IS NULL GROUP BY choice.choice_No ORDER BY choice.choice_No
  20. You have to move the non-null part of the where clause on the on clause (which you don't even have) and then switch the OR to AND.
  21. You need to see for choice.question_ID IS NULL.
  22. If you define the column as AUTO_INCREMENT, it will do it for you if you pass it a NULL value.
  23. Are those single quotes?
×
×
  • 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.