Jump to content

ultrus

Members
  • Posts

    244
  • Joined

  • Last visited

    Never

Everything posted by ultrus

  1. I got it. Never mind. It's something like: SELECT p.first_name, p.last_name, (SELECT i.info_type FROM info i WHERE i.person_id = p.id ORDER BY i.sortby ASC LIMIT 0,1) AS c1_type, (SELECT i.info_type FROM info i WHERE i.person_id = p.id ORDER BY i.sortby ASC LIMIT 1,1) AS c2_type, FROM people p
  2. Hi, I have contact info stored in two tables. Each person in the people table has multiple pieces of contact info (phone number, email, etc.) in the info table. I can left join for multiple rows of fun (with repeating person details) like this: SELECT p.first_name, p.last_name, i.info_type, i.info_content FROM people p LEFT JOIN info i ON i.person_id = p.id resulting in something like this: Bobola, Fossmosto, E, [email protected] Bobola, Fossmosto, P, +1.111.111.1111 How would I alter my query to get something like this? first_name, last_name, c1_type, c1_content, c2_type, c2_content Bobola, Fossmosto, E, [email protected], P, +1.111.111.1111 Thanks for pointers in advance.
  3. I may have found an answer here: http://stackoverflow.com/questions/9285143/mysql-you-cant-specify-target-table-a-for-update-in-from-clause
  4. Hello Gurus, I'm trying to delete rows from a table, but would need to join in some data from another table (that I don't want to delete from), use an embedded SELECT statement, or run multiple queries (don't want to do that last one). Query: DELETE FROM event_guest WHERE guest_id IN (SELECT eg.guest_id FROM event_guest eg LEFT JOIN guest g ON g.id = eg.guest_id WHERE g.attendee_id = '2') Error: #1093 - You can't specify target table 'event_guest' for update in FROM clause But this part works: (SELECT eg.guest_id FROM event_guest eg LEFT JOIN guest g ON g.id = eg.guest_id WHERE g.attendee_id = '2') Any thoughts on how to restructure this correctly? Thanks a ton in advance!!
  5. Ok, maybe your right. I put some good practice in and came up with the same results. Thanks for your help!
  6. There's other divs, but not other divs with the id of "admin-menu", and no other divs inside of that, just a giant unordered list with links. I'm getting close to a solution. Any other thoughts before I beat you to the solution?
  7. Now that I've let it out.... I'm using Dreamweaver, which can make use of regular expressions just like php, to clean up a ton of static archived pages. I want to select content between <div id="admin-menu"> and the next </div> that will be replaced with nothing in my find and replace box. I have to use regex because the content between those tags change from page to page, no other divs though in between so that might help. Any thoughts? This stuff makes my head hurt. Best regards, Chris EDIT: Here's a start, selects any div, contents, closing div (I'm fine if I select the div along with the content). Now I just need to add the ' id="admin-menu"' bit so that I don't select just any content... <div\b[^>]*>(.*?)</div>
×
×
  • 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.