Sorry, I have missed information in my earlir question, that I have added below.
> Joppe A wrote:
>
> Hello all, Please help a newbie ;-) Have a little problem with to
> make a sql-query as I want to have it... The problem is I need to
> check in 3 tables and count out and get it presentated per
Hello all,
Please help a newbe ;-)
Have a little problem with to make a sql-query as I want to have it...
The problem is I need to check in 3 tables and count out and get it presentated
per "n_id" like
n_id counted
01 5
02 10
03 2
My tables look as follows...
In sub:
id
n_id
I'm banging my head against a somewhat strange problem I hope somewhat
more proficient than me can help me with.
I'm trying to setup a central logging-server and having it dump all
input into a MySQL db for easier access from diferent analisys systems.
I've found sysklogd-sql on Sourceforge, wh
> Now, to complicate things further, suppose there is
> yet another table (grandparent, let's say) and there is
> a column in parent that is grandparent_id. I only want
> results where parent.grandparent_id = 'Fred'. How do
> I do that? Is it with a WHERE clause or some other
> SQL magic?
>
> Dean
Dean A. Hoover wrote:
Now, to complicate things further, suppose there is
yet another table (grandparent, let's say) and there is
a column in parent that is grandparent_id. I only want
results where parent.grandparent_id = 'Fred'. How do
I do that? Is it with a WHERE clause or some other
SQL magic?
Now, to complicate things further, suppose there is
yet another table (grandparent, let's say) and there is
a column in parent that is grandparent_id. I only want
results where parent.grandparent_id = 'Fred'. How do
I do that? Is it with a WHERE clause or some other
SQL magic?
Dean
Daniel Kasak wro
Jim Grill wrote:
Suppose I have two tables: parent and
child. I want to create an SQL statement
that will get the count of all children
belonging to parent. Is this possible in
one statement? The one I have works
if parent has children, but not if the
number of children is 0. Here's what
I have:
SE
> Suppose I have two tables: parent and
> child. I want to create an SQL statement
> that will get the count of all children
> belonging to parent. Is this possible in
> one statement? The one I have works
> if parent has children, but not if the
> number of children is 0. Here's what
> I have:
>
>
Dean A. Hoover wrote:
Suppose I have two tables: parent and
child. I want to create an SQL statement
that will get the count of all children
belonging to parent. Is this possible in
one statement? The one I have works
if parent has children, but not if the
number of children is 0. Here's what
I hav
Suppose I have two tables: parent and
child. I want to create an SQL statement
that will get the count of all children
belonging to parent. Is this possible in
one statement? The one I have works
if parent has children, but not if the
number of children is 0. Here's what
I have:
SELECT parent.id,pa
I have a home page where I need to show three news articles which are
specified by the administrator - so it might not be the latest articles
and they might not be in any order. I have designed the db to have two
tables to fulfill this function the first table 'tbl_press' holds the
news articles,
Matthew Stuart wrote:
I have a home page where I need to show three news articles which are
specified by the administrator - so it might not be the latest
articles and they might not be in any order. I have designed the db to
have two tables to fulfill this function the first table 'tbl_press'
I have a home page where I need to show three news articles which are
specified by the administrator - so it might not be the latest articles
and they might not be in any order. I have designed the db to have two
tables to fulfill this function the first table 'tbl_press' holds the
news article
Thanks to You Brent and Bill Easton
and Sorry
Hrmm , that what happen when not clipping direct into mail program ,
here is the Original :-) :
Select A.DepartmentName,A.Address,P.Postcode,P.cityname,CP.firstname
from caddress A,cpostinfo P
left Join CContactPerson CP , caddresscontactperson C
Your syntax is wrong, or at least not standard, if you are trying to do
multiple left joins.
Your ordering is not your typical for a query.
And you say "there" instead of "where".
Your query should be structure like this:
SELECT
FROM , ,...
LEFT JOIN ON
LEFT JOIN ON
LEFT JOIN ON
...
WHERE
on CACP.ContactpersonID=CP.ID and CACP.AddressID=A.ID
left join ccontactinfo CCI
on CACP.ID=CCI.AddressContactPersonID
and CCI.AddressID=-1 and CCI.ContactInfoTypeID=1
where A.ID=10 and A.PostInfoID=P.ID
> Date: Wed, 12 Nov 2003 23:20:10 +0100 (CET)
> Subject: Sql - Proble
Hello
the little Query1 works until I add the left join :
Query 1 )
Select A.DepartmentName,A.Address,P.Postcode,P.cityname
from caddress A,cpostinfo P
there A.ID=10 and A.PostInfoID=P.ID
Query 2)
Select A.DepartmentName,A.Address,P.Postcode,P.cityname,
CP.firstname
left Join CCo
To: [EMAIL PROTECTED]
Subject: constructing SQL problem
Hello ,
I have a problem with constructing correct SQL.
I have tables:
TABLE1 wich have FIELD1 and FIELD2
TABLE2 wich have FIELD1 and FIELD2
TABLE3 wich have FIELD1, FIELD2 and FIELD3
I have th
Hello ,
I have a problem with constructing correct SQL.
I have tables:
TABLE1 wich have FIELD1 and FIELD2
TABLE2 wich have FIELD1 and FIELD2
TABLE3 wich have FIELD1, FIELD2 and FIELD3
I have this SQL:
select a.field1, a.field2, b.field2
Dear Listers,
This is presenting a challenge to my SQL skills of how to attack this,
hopefully someone else might be able to help point me in the right
direction.
I'm building an application to track sports contests. Essentially players,
each of whom are members of a specific "club", guess every
On Wednesday, Oct 23, 2002, at 00:13 America/Phoenix, Mylin Campos
wrote:
Hi all,
I just wanted to know if you guys can help me out with this error.
It's actually an sql and jdbc error.
I have a class called employeeDBUtil. In this class, it has a method
called updateEmployee. I wanted to
It looks like you're missing a comma in your SQL statement in between
placeOfBirth and civilStatus.
Good Luck!
Dennis
- Original Message -
From: "Mylin Campos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 23, 2002 2:13 AM
Subject: sql
Hi all,
I just wanted to know if you guys can help me out with this error. It's
actually an sql and jdbc error.
I have a class called employeeDBUtil. In this class, it has a method called
updateEmployee. I wanted to try if the code would work so I created a main
portion in my class.
java.sq
Whoa,
I've had this message 3 times now. Is there a problem somewhere?
George
- Original Message -
From: "Ben Edwards" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 28, 2002 3:38 PM
Subject: where exists sql problem
> having problem
PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
Ben Edwards
Sent: Thursday, March 28, 2002 9:39 AM
To: [EMAIL PROTECTED]
Subject: where exists sql problem
having problems working out sql where exists syntax.
Tried query
select *
from sections s
where exists
select 0
having problems working out sql where exists syntax.
Tried query
select *
from sections s
where exists (
select 0
from pages s
where s.page = p.page
)
Any ideas,
Ben
--
[EMAIL PROTECTED]+44 (0)7970 26
Dear Vincent,
> I have 2 numeric column a,b in my table.
> I want to retrieve rows which a in range
> x~y, but b not in this range. So I wrote
> a SQL statement
>
> select * from where
> ( a > x and a < y ) and ( b < x or b > y )
>
> But wrong result returned with this
> statement. Is this SQL w
Dear all,
I have 2 numeric column a,b in my table.
I want to retrieve rows which a in range
x~y, but b not in this range. So I wrote
a SQL statement
select * from where
( a > x and a < y ) and ( b < x or b > y )
But wrong result returned with this
statement. Is this SQL wrong?
Thanks for yo
Dear all,
I have 2 numeric column a,b in my table.
I want to retrieve rows which a in range
x~y, but b not in this range. So I wrote
a SQL statement
select * from where
( a > x and a < y ) and ( b < x or b > y )
But wrong result returned with this
statement. Is this SQL wrong?
Thanks for y
G'day all,
For some reason I am receiving messages from the MySQL list (only) which I
have already received - some more the a week ago. Is anyone else getting
repeat posts?
kim
-
Before posting, please check:
http://www.mys
Hi
It would be great if anyone could help me with a problem in mySQL.
I have 3 tables to describe attributes for a product database.
e.g.
attribute_type:
++--+--+
| id | name | unit |
++--+--+
| 1 | height | cm |
| 2 | width| cm |
Hi
It would be great if anyone could help me with a problem in mySQL.
I have 3 tables to describe attributes for a product database.
e.g.
attribute_type:
++--+--+
| id | name | unit |
++--+--+
| 1 | height | cm |
| 2 | width| cm |
> Here's a conundrum I'm having with MySQL.
>
> The following code returns a bunch of records:
>
> SELECT sl_Year,
>sl_DayOfYear,
>sl_Query,
>SUM(sl_CountOfOccurrences) AS NumRequests
> FROM SearchLog
> GROUP BY sl_Year,
> sl_DayOfYear,
> sl_Query
>
> o
Here's a conundrum I'm having with MySQL.
The following code returns a bunch of records:
SELECT sl_Year,
sl_DayOfYear,
sl_Query,
SUM(sl_CountOfOccurrences) AS NumRequests
FROM SearchLog
GROUP BY sl_Year,
sl_DayOfYear,
sl_Query
one of these records looks li
Hi.
This is dicussed here:
http://www.mysql.com/doc/G/r/Group_by_functions.html
(after the function list)
http://www.mysql.com/doc/E/x/Examples.html (see the subsections)
Bye,
Benjamin.
On Sat, Nov 24, 2001 at 11:01:26PM +0530, [EMAIL PROTECTED] wrote:
> Hello Everyone,
>
> I wants
Hello Everyone,
I wants to find the max. date and Login status of employee for Attendance
table.
The qurey runs fine but it shows me the wrong status.
select max(a.dAtt_Date),a.nLog_Status from tbl_attendance a,tbl_attendance b
where a.nEmp_id = 1 and a.nLog_Status = b.nLog_Status
group by b.nEm
SELECT (t1.cnt1 + t2.cnt3 - t3.cnt11) FROM table
t1, table t2, table t3 WHERE t1.ColPoint=1 AND
t2.ColPoint=5 AND t3.ColPoint=2 AND t1.id=1 AND
t2.id=t1.id AND t3.id=t1.id
Of course, self joins can be expensive, this grows
in complexity as you need to add/subtract more
counts ,and this is not ge
i have a MySQL DB whit this tabel:
Id ColPoint CntDateTime Cnt1 Cnt2 Cntx. Cnt32
11 2001-08-01 00:05:0012 14
21 2001-08-01 00:10:0011 12
31 2001-08-01 00:15:00109
41 2001-08-01 00:20:000
>Hello,
>
>I am having a lot of trouble trying to find the best
>way to write the SQL to do the following:
>
>I have a table called "referrals." In this table I
>have a column called "ref." The data in the ref column
>
>are of the form "p/$promo_id/$date". An example would
>be "p/26/20010629" whic
Hello,
I am having a lot of trouble trying to find the best
way to write the SQL to do the following:
I have a table called "referrals." In this table I
have a column called "ref." The data in the ref column
are of the form "p/$promo_id/$date". An example would
be "p/26/20010629" which says p
>I have a problem adapting a multiple select to MySQL.
>Can someone help me ?
>
>Here is my request (Oracle format)
>
>SELECT Tactic.teamCode FROM Tactic WHERE
>Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE
>Game.gameTurn = Turn.code)
>AND Tactic.teamCode NOT IN (SELECT Game.
ic" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, May 28, 2001 14:41
> Subject: SQL Problem
>
>
> > I have a problem adapting a multiple select to MySQL.
> > Can someone help me ?
> >
> > Here is my request (Oracle
On Mon, 28 May 2001, Lefebvre, Cedric wrote:
>
> I have a problem adapting a multiple select to MySQL.
> Can someone help me ?
>
> Here is my request (Oracle format)
>
> SELECT Tactic.teamCode FROM Tactic WHERE
> Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE
> Game.gameTu
h it.
- Original Message -
From: "Lefebvre, Cedric" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 28, 2001 14:41
Subject: SQL Problem
> I have a problem adapting a multiple select to MySQL.
> Can someone help me ?
>
> Here is my reques
AFAIK MySQL does not yet support sub-selects.
--zak
- Original Message -
From: "Lefebvre, Cedric" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 28, 2001 12:41 AM
Subject: SQL Problem
> I have a problem adapting a multiple select to MyS
I have a problem adapting a multiple select to MySQL.
Can someone help me ?
Here is my request (Oracle format)
SELECT Tactic.teamCode FROM Tactic WHERE
Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE
Game.gameTurn = Turn.code)
AND Tactic.teamCode NOT IN (SELECT Game.teamCode2
> Sent: Wednesday, January 24, 2001 13:51
> Cc: MySQL List
> Subject: sql problem - it may be a version problem ??
>
>
> hi everybody !!!
>
>
> i need to resolve the following query ( a silly one ) in a
> mysql server
> 3.22.30
> and i get the followin
hi everybody !!!
i need to resolve the following query ( a silly one ) in a mysql server
3.22.30
and i get the following error:
mysql> select count(distinct ip_dst) from iphdr;
ERROR 1064: You have an error in your SQL syntax near 'distinct ip_dst)
from iphdr' at line 1
mysql>
48 matches
Mail list logo