wwfc_barmy_army Posted December 18, 2006 Share Posted December 18, 2006 Hello.I have a table and in that table is a field with either 1,2,3,4...10. Although a number of records can have for example number 1.[b]Example[/b][table][tr][td]Field 1[/td][td]Field 2 (number field)[/td][/tr][tr][td]name[/td][td]1[/td][/tr][tr][td]name[/td][td]1[/td][/tr][tr][td]name[/td][td]1[/td][/tr][tr][td]name[/td][td]2[/td][/tr][tr][td]name[/td][td]3[/td][/tr][/table]So i would want it to print 1,2,3 not 1,1,1,2,3.How would i do this?Thanks. Link to comment https://forums.phpfreaks.com/topic/31088-solved-getting-one-number-from-records/ Share on other sites More sharing options...
HuggieBear Posted December 18, 2006 Share Posted December 18, 2006 I'm not sure I understand exactly what you mean, the following query will give what you've asked for, but whether it's actually what you want is another thing all together:[code=php:0]SELECT DISTINCT field_2 FROM table_name ORDER BY field_2[/code] RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/31088-solved-getting-one-number-from-records/#findComment-143537 Share on other sites More sharing options...
wwfc_barmy_army Posted December 18, 2006 Author Share Posted December 18, 2006 Spot on! Cheers :) Link to comment https://forums.phpfreaks.com/topic/31088-solved-getting-one-number-from-records/#findComment-143545 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.