Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

mysql display unique using php

Posted on 2014-03-12
6
Medium Priority
?
458 Views
Last Modified: 2014-03-12
hello,
I have about 12,000 records inside mysql table and I would select everything and just display the "names" from a Column without duplicates.. how can I do this using php?
0
Comment
Question by:XK8ER
  • 3
  • 3
6 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39923821
SELECT UNIQUE namecolumn,othercolumns FROM table WHERE namecolumn='name'

Open in new window

0
 
LVL 1

Author Comment

by:XK8ER
ID: 39923872
i dont know the names so how do I do that?
0
 
LVL 58

Expert Comment

by:Gary
ID: 39923875
Then remove that part

SELECT UNIQUE column_name,other_columns FROM table

Open in new window

0
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 1

Author Comment

by:XK8ER
ID: 39923881
your code did not work.. but this works


SELECT DISTINCT (stockSymbol ) AS daStock FROM US500 ORDER BY daStock DESC  

Open in new window

0
 
LVL 58

Expert Comment

by:Gary
ID: 39923903
Oops wrong database type.
0
 
LVL 1

Author Comment

by:XK8ER
ID: 39924565
I've requested that this question be deleted for the following reason:

found the answer myself
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
The viewer will learn how to count occurrences of each item in an array.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month9 days, 14 hours left to enroll

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question