Read all about Join in the manual -- it includes hints like this query:
SELECT DISTINCT(PersonID) FROM PersonProject AS P1
LEFT JOIN PersonProject AS P2 ON P2.PersonID=P1.PersonID AND
P2.ProjectID=2
WHERE P2.PersonID IS NULL;
Cheers,
Kent
That is exactly what I want, Thanks Rafal
PS: does anybody know if there are plans to support nested queries in mySQL?
Hi,
maybe something like this:
select a.PersonId from PersonProject a left join PersonProject b
on(a.PersonID=b.PersonID and b.ProjectID=2) where b.PersonID
is null group
On Fri, 22 Jun 2001, Thomas J Keller wrote:
select zip, city, county from zipcodes where zip between 68400 and 68500;
here is a portion of the garbled output:
|68442 | STELLA | RICHARDSON
|43 | STERLING | JOHNSON
|444 | STRANG | FILLMORE
|5 |
Hi,
Is there a way to retrieve the field values in the
same order as during insertions based on something
like rowid or so??
Eg:
Insertion order into a table for a text field:
bbb
abaa
aa
Retrieval order:
I want to have the retrieval order also the same.The
output of the query on
On 22-Jun-01 VVM Ravikumar Sarma Chengalvala wrote:
Hi,
Is there a way to retrieve the field values in the
same order as during insertions based on something
like rowid or so??
Eg:
Insertion order into a table for a text field:
bbb
abaa
aa
Retrieval order:
I want to
Hi.
On Fri, Jun 22, 2001 at 05:31:32PM +0100, [EMAIL PROTECTED] wrote:
Hi,
Is there a way to retrieve the field values in the
same order as during insertions based on something
like rowid or so??
No. Insertion order is not kept anywhere. Use an AUTO_INCREMENT column
to obtain an key to
I am using two versions of MySQL, on two different platforms, and having the
same problem on both. One very odd aspect of this problem is that it behaves
precisely the same way on both platforms, down to which records are garbled
onscreen and how they are garbled. Anyone with any ideas?
Hi.
On Mon, Jun 18, 2001 at 02:32:13AM +0100, [EMAIL PROTECTED] wrote:
I need some help with a query to sum data for each id and write it into a
new table.
I have a source data table for each calendar month containing i.d.'s (not
unique) and a value and I need to sum all the values for
I need some help with a query to sum data for each id and write it into a
new table.
I have a source data table for each calendar month containing i.d.'s (not
unique) and a value and I need to sum all the values for each i.d. for all
months into a new table (where each i.d. will now be unique).
At 2:32 AM +0100 6/18/01, [EMAIL PROTECTED] wrote:
I need some help with a query to sum data for each id and write it into a
new table.
I have a source data table for each calendar month containing i.d.'s (not
unique) and a value and I need to sum all the values for each i.d. for all
months into
What is the error in this sql query ???
_
CREATE TABLE page(
page_ID INT (9) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
relative_path VARCHAR (200) Not NULL,
keywords VARCHAR (200) ,
have_vote ENUM (3),
PRIMARY KEY(page_ID),
UNIQUE(page_ID),
INDEX
have_vote ENUM (3),
must be this:
have_vote ENUM ('3'),
Greetings,
Ansgar
What is the error in this sql query ???
_
CREATE TABLE page(
page_ID INT (9) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
relative_path VARCHAR (200) Not NULL,
keywords
Subject: What is the error in this sql query
What is the error in this sql query ???
_
CREATE TABLE page(
page_ID INT (9) UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
relative_path VARCHAR (200) Not NULL,
keywords VARCHAR (200) ,
have_vote ENUM (3),
PRIMARY
I would say line 2, DEFAULT 0 not DEFAULT '0'.
- Original Message -
From: Syed sumair [EMAIL PROTECTED]
To: MySQL List [EMAIL PROTECTED]
Sent: Friday, June 01, 2001 7:11
Subject: What is the error in this sql query
What is the error in this sql query
|
++-+
PS : The agent no 25 has not come because he does not hv any association
with deptid 19.
Can anybody pls give me the SQL query to generate the above resultset ?
Regards
Harsh
http://mail.indiainfo.com
First you had 10MB of free mail space.
Now you can
|
| 1 | 27 |
++-+
PS : The agent no 25 has not come because he does not hv any
association
with deptid 19.
Can anybody pls give me the SQL query to generate the above resultset
?
SELECT count(b.dept) as cnt,a.agent as agent
FROM tbl as a LEFT JOIN tbl as b
Hi,
System Specs:
SCO Openserver 5.0.6
MySQL 3.23.38
I have the following SQL Query (don't worry about the table aliasing)
SELECT
vdm1.model, vdm1.version, vdm1.date_ls_ro,
zdna1.code, zdna1.name, zdna1.title,
zdna1.phone_bus, zdna1.phone_home,
zdna1.pstl_adr_1, zdna1
Hello,
I have a problem composing a sql-statement for my special needs.
I hope anybody can help me.
This is the situation:
I have 2 tables, a and b as following:
--
| a |
--
| eid | name |
--
--
| b|
in SQL query can we use sysdate to get System date like Oracle
_
Chat with your friends as soon as they come online. Get Rediff Bol at
http://bol.rediff.com
-
Before
On Thu, May 10, 2001 at 10:24:11AM -, AVDHUT SHEDGE wrote:
in SQL query can we use sysdate to get System date like Oracle
What's wrong with NOW(), as seen in the manual?
Reference Functions Date and Time Functions
Next time, take a look there :)
G'luck,
Peter
--
yields falsehood, when
On 10-May-01 AVDHUT SHEDGE wrote:
in SQL query can we use sysdate to get System date like Oracle
mysql select SYSDATE();
+-+
| SYSDATE() |
+-+
| 2001-05-10 05:46:28 |
+-+
Does Orkcle have manuals ?
Regards,
--
Don Read
We want to get the Unique value from a table.
can we use the following query:
select unique(ProblemNo) from MainProblem;
where MainProblem is a Table having Column ProblemNo.
the contents of ProblemNo are
1
1
2
2
3
3
3
the result of the above query must be :
1
2
3
Thank You.
use distinct() instead.
- Original Message -
From: AVDHUT SHEDGE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 08, 2001 3:00 PM
Subject: Regarding SQL query with Unique
We want to get the Unique value from a table.
can we use the following query:
select unique
AVDHUT SHEDGE wrote:
We want to get the Unique value from a table.
can we use the following query:
select unique(ProblemNo) from MainProblem;
where MainProblem is a Table having Column ProblemNo.
the contents of ProblemNo are
1
1
2
2
3
3
3
the result of the above query must
Hi,
I have a table that keeps track of when certain articles go up on the
site. It has a field called featureStart, which is a unix timestamp. The
features stay on the site until the next feature replaces them, so there
is no featureEnd. If one feature started on Apr 23 and another one is
Greetings:
Prelude: We have five tables all sharing a very similar structure (each has
a Customer_ID and Server_ID field for example).
Each table can contain zero to many records with duplicate Server_ID values
allowed.
Need: I need to be able to count the distinct Server_ID's across all of
Hi there,
So a question
I have two tables. And i want to... (i just show you)
Table 1.
OwnerChar(30)Uniqe
FileChar(80)
OIDint(not in use yet)
Table 2.
IDintuniqe and so on
OwnerChar
NameChar
adress
It's not possible to do in one step in MySQL.
--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/
"roger westin" [EMAIL PROTECTED] wrote:
So a question
I have two tables. And i want to... (i just show you)
Table 1.
OwnerChar(30)Uniqe
File
I have been trying for the last while to come up with a query that will do
the following:
Say I have table with these records:
StartDate StopDate
---
2001-01-23 23:43:12 2001-01-24 04:29:12
2001-01-24 15:24:00 2001-01-26
: Wednesday, March 28, 2001 15:53
To: Alberni-dot-Net
Cc: [EMAIL PROTECTED]
Subject: RE: Complex SQL Query
Aaron,
Are you inserting both values at once? Or inserting the startdate first,
then
updating the stopdate later. You may or may not be able to do this in one
query.
To determine how much time
Hi , i have the following method:
public Object getValueAt(int row, int column){
// in here i want to construct a SQL query which gives the object at a
certain
row and column
}
Do you know how to do it?
Thanks
Pawan
Pawan Kanda wrote:
Hi , i have the following method:
public Object getValueAt(int row, int column){
// in here i want to construct a SQL query which gives the object at a
certain
row and column
}
Do you know how to do it?
Thanks
Pawan
Maybe make your sql statement read
sql
hi,
i'm writing a book (wrox publishers) which uses mysql for the sample
database.
i seem to have encountered a problem with an SQL query.
its a simple voting application, with a candidate table, and a vote table:
create table candidate (
candidatenumber integer not null auto_increment
PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: SQL query problem with mysql.
hi,
i'm writing a book (wrox publishers) which uses mysql for the sample
database.
i seem to have encountered a problem with an SQL query.
its a simple voting application, with a candidate table, and a vote table
Cc: [EMAIL PROTECTED]
Sent: Monday, March 05, 2001 3:54 AM
Subject: SQL query problem with mysql.
hi,
i'm writing a book (wrox publishers) which uses mysql for the sample
database.
i seem to have encountered a problem with an SQL query.
its a simple voting application, with a candidate table,
hi,
i'm writing a book (wrox publishers) which uses mysql for the sample
database.
i seem to have encountered a problem with an SQL query.
its a simple voting application, with a candidate table, and a vote table:
create table candidate (
candidatenumber integer not null auto_increment
Okay, here's one for the guru's out there :)
I have a list of entries with unique id numbers X, and a set of sort methods
(S1 ... Sy).
Now, if I want to get an entry at position P (0...z) in the list of
entries ordered by method S1 then I'd
make the following query:
SELECT X FROM table WHERE
On Tue, Jan 23, 2001 at 05:39:47PM +0100, Sander Pilon wrote:
Okay, here's one for the guru's out there :)
I have a list of entries with unique id numbers X, and a set of sort methods
(S1 ... Sy).
Now, if I want to get an entry at position P (0...z) in the list of
entries ordered by
401 - 438 of 438 matches
Mail list logo