Trying To Select Some Data

    Date: 01/15/06 (MySQL Communtiy)    Keywords: php, mysql, sql

    i'm trying to select some data from a table. this bit i'm doing quite well with, however it's returning two rows per 'primary key' based on a left join. i've tried using DISTINCT but that doesn't seem to effect it. i then i tried using GROUP BY and that did, so now i'm getting the one row per primary key i was originally after, but i seem to be getting this data without the data of the left join i so desperately need. upon further investigation, back when i was getting two rows per primary key, only the second row per primary key had the data i was after. is their anyway to make sure the query returns the second row as opposed to the first?

    my initial idea was to add a clause, but not all rows in the table will have data in that column, i just want to make sure rows with data in that column will definately be returned.

    any suggestions?




    x-posted to '[info]'mysql and '[info]'php_mysql

    Source: http://community.livejournal.com/mysql/81895.html

« Update multiple tables || Fulltext index error »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home