Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You can't add a primary key with that syntax in the middle of the column spec. Use this: CREATE TABLE $seller ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, rating VARCHAR(30), feedback VARCHAR(250))
  2. And once they are proper DATETIME fields, you can use WEEK() to extract a week number for grouping.
  3. You mean like sed?
  4. Like I said earlier, you need to gather all of the individual field restrictions first, and then combine them.
  5. Sounds like you have the wrong login credentials.
  6. This is a continuation of this thread -- don't double-post next time. Put the where clause before the having clause.
  7. Like this: IF( gender = 'male', 10, 0 ) + IF( eye_color = 'blue', 5, 0 )
  8. This feels very much like the same issue as you posted in this thread.
  9. You can simply INNER join these two tables.
  10. I just don't see how either of those could generate that error message...
  11. LOAD DATA takes an optional IGNORE N LINES option.
  12. You may want to read this... but basically, you need to generate a table of the 3 new products per group first, and then join it back.
  13. If you're asking about simply loading/saving fields, then there are plenty of tutorials that describe this.
  14. What error do you get with this?
  15. You can't use mysql_result() around that query.
  16. Well, it's "flipped" around your tables... did you try STRAIGHT JOIN?
  17. Sorry, didn't realize you didn't get *any* output yet... ;-) Try this: SELECT COUNT(*), COUNT( DISTINCT states ) FROM lodges WHERE status='1'
  18. You need to push your $row variable onto another array with larger scope.
  19. Did you run ANALZYE TABLE recently?
  20. Why the outer query? And why not use the second query ($matches) but just replace "SELECT id" with "DELETE"?
  21. You can use CSV as an engine type...
  22. Let's see the query... DISTINCT is not an expression.
  23. LEFT and RIGHT are OUTER joins. JOIN is an INNER join (it's implied). Usually, I would write INNER JOIN vs. LEFT JOIN to make the distinction. LEFT vs. INNER -- normally, with an INNER join, if there are non-matching rows based on the join condition, no rows will be returned. With a LEFT join, rows from the first table with non-matching rows will yield NULLed out column for the fields in the second table -- making it possible to find non-matches (like movie reviews without votes, etc.). RIGHT is the opposite, but the convention is to use LEFT JOIN.
  24. Assuming you mean logical AND and not database AND. If you want to weight it, then just SUM() up successive IF() expressions that give different weights.
×
×
  • 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.