Solved

PHP MySQL Select *, repeat all, but no duplicates...

Posted on 2009-07-13
2
1,801 Views
Last Modified: 2013-11-10
Hi,  

What code do i need to add so that...
when i perform a query from a MySQL database and run them through a repeat all...
it will not display duplicates..

e.g.
Every Record i am querying on has a year value. i.e. 2008,2009 etc
Several Records may have the same year value i.e. 2008,2008,2009,2009

I want to not display the year multiple times, only once?

Thanks!


0
Comment
Question by:dev09
2 Comments
 
LVL 59

Accepted Solution

by:
Kevin Cross earned 125 total points
ID: 24839382
What you can do is to SELECT DISTINCT to get your listing of years in data?  Something like this:
SELECT DISTINCT year FROM your_table;

Open in new window

0
 
LVL 7

Assisted Solution

by:ajkhalifa
ajkhalifa earned 125 total points
ID: 24842364
using DISTINCT keyword after SELECT
SELECT DISTINCT [column] FROM [table_name]
if the table is too large then running DISTINCT is a big deal... there are advance solutions...
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
paypal ipn to mysql 3 35
mysql update statement 3 22
editing example file and creating an accessible same directory error log txt file 2 26
website maintenance mode 1 17
This article discusses four methods for overlaying images in a container on a web page
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

805 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