Jump to content

fenway

Staff Alumni
  • Posts

    16,168
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by fenway

  1. You could use a trigger....
  2. Hard to say... that's a dependent subquery -- only run once for the outer query -- and obviously the DISTINCT would make that subquery take longer. However, NOT IN() would have to check a longer list without the DISTINCT. They're both bad.
  3. Not sure.. though in this case you don't really need an BEGIN/END block at all.
  4. Actually, it is... unless it's inside COUNT().
  5. Sigh... run this: SELECT cast(left(itemNumber+ '-0', instr(itemNumber+ '-0', '-')) as unsigned) as part1, cast(mid(itemNumber+ '-0', instr(itemNumber+ '-0', '-')+1) as unsigned) as part2, * FROM tblPlantilla
  6. Amend how?
  7. Missing quotes for those format specifiers.
  8. Why INOUT? It should probably be just IN.
  9. What do you mean by that, sir? I mean I'd like to see what those expression return.
  10. Could you include each of those expressions in the column list?
  11. No, your question revolves around a database query... but therein lies your actual problem. If you don't know how to use the tool you've chosen for the job to implement the solution, then you've wasted my time, not vice versa. But hey, by all means, wait for someone else's help -- you will receive no more from me.
  12. I have no idea what dreamweaver automatically does. You need some control loops to handle this.
  13. Huh?
  14. Not that I can think of... but there are some stickies that will help guide you.
  15. Huh?
  16. You could search with a UNION... you'll just have to alias the first column name.
  17. Can't be that automatic... though a left join could find them esaily.
  18. You have 2 conditions: #1: WHERE state = '$state' #2: WHERE state = '$state' AND city = '$city' SQL can't decide when do #1 vs #2 -- you need php application code to do this. I don't know what part of this is "difficult".
  19. fenway

    [SOLVED] ENUM

    You can change the sql mode for a given connection.
  20. Sounds reasonable... to be honest, I've never made it smaller, only larger.
  21. You *don't* want it to search both fields... you want it to search state always, and city sometimes.
  22. You can't limit on a join... you'd have to create a derived table with this artificial limit, then join it back.
  23. I sure can fulltext across multiple tables I may need to use multiple queries but it can be done It can't be done without multiple queries... but that's not going to "use" an index.
  24. You can't check count in the where clause.... that subquery should be SELECT `Tag` FROM `Tags` WHERE `Tag` = `user_tag` GROUP BY `Tags`.`Tag HAVING COUNT( `Tags`.`Tag` ) > 2
  25. You need to handle this in your php code first... figure out which fields are present, then build your where clause accordingly.
×
×
  • 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.