wright67uk Posted January 22, 2013 Share Posted January 22, 2013 When using distinct, how can you determine which columns will and will not be effected? In the below query, im looking for distinct values of ONLY fname and lname, but not any other column. ("SELECT DISTINCT registration.fname, registration.lname, snag.club, snag.date, snag.yard, snag.year FROM registration, snag ORDER BY yards ASC"); Link to comment https://forums.phpfreaks.com/topic/273474-using-distinct-only-on-defined-columns/ Share on other sites More sharing options...
requinix Posted January 22, 2013 Share Posted January 22, 2013 DISTINCT there will apply to all the columns combined. Your query is nonsensical. SELECT fname, lname FROM registration -- ORDER BY yards ASC if it's in the registration table Link to comment https://forums.phpfreaks.com/topic/273474-using-distinct-only-on-defined-columns/#findComment-1407425 Share on other sites More sharing options...
Barand Posted January 23, 2013 Share Posted January 23, 2013 I am marking this as solved as you have now started another thread on the same problem Link to comment https://forums.phpfreaks.com/topic/273474-using-distinct-only-on-defined-columns/#findComment-1407687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.