How about actually using distinct?
SELECT DISTINCT(email_addr) FROM myTable WHERE x = 1
--Toby
- Original Message -
From: "Jason Caldwell" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, April 18, 2001 1:47 AM
Subject: [PHP] mySQL Question
if i perform a SE
if i perform a SELECT query (say) like the following:
SELECT email_addr FROM myTable WHERE x = 1
in this query i want to pull-out (or list) all email addresses where x
equals 1, however, suppose i don't want any duplicate email addresses...
would i use ORDER BY and COUNT(*) to get listing of
if i perform a SELECT query (say) like the following:
SELECT email_addr FROM myTable WHERE x = 1
in this query i want to pull-out (or list) all email
addresses where x equals 1, however, suppose i don't want any
duplicate email addresses... would i use ORDER BY and COUNT(*) to
get listing
Opps. I meant GROUP BY... and it looks like I don't need to include the
COUNT().
SELECT email_addr, x GROUP BY email_addr HAVING x = 1;
Is this the only way to display a listing without duplicates, or is there a
more efficient (faster) way? I don't want to DELETE the duplicates, just
don't
On 18-Apr-01 Jason Caldwell wrote:
Opps. I meant GROUP BY... and it looks like I don't need to include the
COUNT().
SELECT email_addr, x GROUP BY email_addr HAVING x = 1;
Is this the only way to display a listing without duplicates, or is there a
more efficient (faster) way? I don't
]]
Sent: Saturday, March 10, 2001 6:01 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP/MySQL Question
Having some problems with syntax.
If I wanted to SELECT only 5 instances of something from a database and
order it by datetime, how would I do that?
- Kath
--
PHP General Mailing List (http
I have a user database where a year has to be put in.
Now, I want to compile a list of each different year and how many users are in that
year.
Is there a way to do this beyond coding for each year:
SELECT * FROM students WHERE year = '1983' ?
- Kath
You could try something like this:
SELECT year, count(studentID) FROM students GROUP BY year
...where studentID is the primary key column/field in your students table.
Josh Hoover
KnowledgeStorm, Inc.
Searching for a new IT solution for your company? Need to improve your
product marketing?
select count(*), year from students group by year;
on 3/1/01 12:07 PM, Kath at [EMAIL PROTECTED] wrote:
I have a user database where a year has to be put in.
Now, I want to compile a list of each different year and how many users are in
that year.
Is there a way to do this beyond
Can i know the date of the last table update in a Mysql database?
You can add a field named 'modified' that is of type 'timestamp' and use:
select max(modified) from blah;
I don't know of any documented way to check the last modified time for a
whole table.
--
Visit the Zend Store at
Is it possible know the date and the time of the last update of a table in a MYSQL
Database?
Bye!
Is it possible to move through an array that is returned as a recordset
and then move back to the beginning of the array.
Julia
--
[ Julia Anne Case ] [Ships are safe inside the harbor, ]
[Programmer at large] [ but is that what ships are really for.]
[ Admining
reset($array), if this is what you need.
this resets (who would have thought it?) the internal pointer back to the
first
position.
""Julia A . Case"" [EMAIL PROTECTED] schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Is it possible to move through an array that is returned
usion, PHP, and mySQL
http://www.wizaerd.com
=
-Original Message-
From: Julia A . Case [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 4:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP/MySQL question
Is it possible to move throug
I created a table with FaceMysql that had one field and I could not add data
to it .Only when I recreated it with 2 fields and a primary key did it
work.Is there any reason for this?Must there always be a primary key in
Mysql?I've never known this to be true of relational Db's.Especially if you
mysql use myisamchk and myisamchk --recover to check and repair the table.
However, does anybody know how myisamchk indicates that whether the table is
damaged or
whether the the repair is successful when running myisamchk or
myisamchk --recover command?
--
PHP General Mailing List
101 - 116 of 116 matches
Mail list logo