Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. fenway

    SQL Help

    If you had each user's pick in a separate row, this would be super easy.
  2. Each question should be a record in a questions table.
  3. Didn't get that part... ;-) Good luck.
  4. Of course not... did you update all of the existing values?
  5. There are many stickies on the forum... but the mysql dev zone is a great place to start.
  6. Via normalization. See the relevant sticky.
  7. For any one who's interested, the problem was the tinyint as the PK... UNSIGNED INT or bigger should have been the choice of datatype.
  8. Untested: SELECT p.proj_id, p.proj_name, CONCAT(DATE_FORMAT(up.updated, '%Y-%m-%d'),': ',up.progress) AS progress INNER JOIN update_progress AS up ON ( up.proj_id = p.proj_id ) INNER JOIN ( SELECT proj_id, MAX(updated) AS maxUpdated FROM update_progress GROUP BY proj_id ) AS sub ON ( sub.proj_id = up.proj_id AND sub.maxUpdated = up.updated ) [code] [/code]
  9. Run a query with MAX(updated) on the progress table and group by proj_id. Then use this derived table and join on proj_id, and show the desired columns.
  10. You need to find the most recent update first (group by and max) then join this to the proj tables.
  11. Welcome to the forum! Sounds about right... I'm not too familiar with the phpmyadmin interface.
  12. wat is meant by indexes? thanks Seriously? Then read all the stickies first before posting anything else or ever working on a database.
  13. You should read up on transactions.
  14. It counts the number of times a given song name shows up in your recordset... I don't know what "pulled from the db" means.
  15. Indeed it will.
  16. There's a sticky, too.
  17. This is easier to read: WHERE date_purchased > NOW() - INTERVAL 2 YEAR
  18. If there aren't any posts, fp.* will be null, so you won't match and ft records, and then no user records either... so it really should be an inner join. Did you index any of the other columns? What version of mysql are you running?
  19. Actually there's a "create table like" option to get the structure... and then you can simply insert into... select where 1=1.
  20. It will use 1004 as the next pid -- as it should. And don't even think about manging this through php, it's impossible.
  21. Have you read the mysql refman page on this subject/
  22. No problem (untested): SELECT t1.* FROM tbl_data AS t1 INNER JOIN ( SELECT t2.lastname, t2.firstname, COUNT(*) AS cnt FROM tbl_data AS t2 GROUP BY t2.lastname, t2.firstname HAVING cnt > 1 ) AS t2 ON ( t2.lastname = t1.lastname AND t2.firstname = t1.firstname) --fenway: edited a typo
  23. I have no idea what either of you are talking about. MAX(PID) will get the highest uid... but what does "last" mean/
  24. Your PK isn't auto_increment?!?!
  25. The "range" is a REGEXP.
×
×
  • 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.