Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. I see INSERT, not update.
  2. Please post the offending query here.
  3. OK, then make it easier to digest for the rest of us. Take a single script, find the sql query, echo it to the browser, check for error messages, and drop the redirect for testing.
  4. You can issue an ALTER statement with MODIFY, and then specify BEFORE/AFTER.
  5. I'm saying that you can specify NOT NULL, and use different values.
  6. Please use code tags next time -- is this solved?
  7. I don't need to see you code -- compare $getaddress with $list and you'll see what I mean.
  8. You don't need to run the alter statement, truncate does that automatically.
  9. Depends how the records in A and B are related... a LEFT JOIN may be enough.
  10. How about a column list?
  11. Oh, I see... you mean your query, not "SQL" in general. Yes, NULL aren't fun to use for date ranges. DATE supports '1000-01-01' to '9999-12-31' -- if you use these values (or 0000-00-00, depending on your sql mode), instead of NULLs, then your queries will work just fine -- besides, it makes the data and index smaller anyway .
  12. You can, but why does it matter?
  13. Use: select trxtal.groupno as groupn,artwork.artworkno as artworkno,count(trxtal.groupno) as grp from (trxtal, mstcus) LEFT JOIN artwork ON (trxtal.groupno=artwork.groupno and trxtal.classcode=artwork.classcode) where trxtal.groupno=mstcus.groupno group by mstcus.groupno having sum(artwork.artworkno)>0 But really, don't use commas to join tables... it's very bad form.
  14. Not sure I understand what the code is really doing...
  15. Sure, use CASE.
  16. If it's not being inserted, it's either not being called or there's an error. The statement you're passing to mysql_query()
  17. Why not simple add the day part and use proper date math?
  18. What do you mean "SQL doesn't work with NULL"?
  19. That's a prepared statement.
  20. Like I said, get the unique, ordered list of letters, and limit that -- if used in a derived table, you can join that back to whatever you want.
  21. That's impossible.
  22. DISTINCT isn't a function... and since you're getting back IDs, it won't do anything. What do you want grouped?
  23. Sure, you can use an IF().
  24. Can we see the sql statement and any associated error messages?
  25. I prefer EXTRACT( YEARMONTH from yourField ) rather than using string functions... it's more explicit and future-proof.
×
×
  • 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.