Re: SQL problem

2005-02-23 Thread Joppe A
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

SQL problem

2005-02-23 Thread Joppe A
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

MySQL version and sysklogd-sql problem

2004-10-24 Thread Frank Larsen
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

Re: sql problem

2004-09-08 Thread Jim Grill
> 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

Re: sql problem

2004-09-08 Thread Daniel Kasak
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?

Re: sql problem

2004-09-08 Thread Dean A. Hoover
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

Re: sql problem

2004-09-08 Thread Daniel Kasak
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

Re: sql problem

2004-09-08 Thread Jim Grill
> 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: > >

Re: sql problem

2004-09-08 Thread Daniel Kasak
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

sql problem

2004-09-08 Thread Dean A. Hoover
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

Re: SQL problem

2004-05-06 Thread SGreen
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,

Re: SQL problem

2004-05-06 Thread gerald_clark
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'

SQL problem

2004-05-06 Thread Matthew Stuart
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

Re: Sql - Problem with Left Join

2003-11-13 Thread Kim G. Pedersen
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

Re: Sql - Problem with Left Join

2003-11-13 Thread Brent Baisley
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

Sql - Problem with Left Join

2003-11-12 Thread Bill Easton
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

Sql - Problem with Left Join

2003-11-12 Thread Kim G. Pedersen
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

RE: constructing SQL problem

2003-07-10 Thread Rudy Metzger
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

constructing SQL problem

2003-07-10 Thread Krasimir_Slaveykov
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

Multi-table summary SQL problem/question

2003-01-24 Thread Peter D Bethke
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

Re: sql problem

2002-10-23 Thread Clayburn W. Juniel, III
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

Re: sql problem

2002-10-23 Thread Dennis Salguero
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

sql problem

2002-10-22 Thread Mylin Campos
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

Re: where exists sql problem

2002-03-28 Thread George Pitcher
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

RE: where exists sql problem

2002-03-28 Thread nickg
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

where exists sql problem

2002-03-28 Thread Ben Edwards
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

Re: SQL problem?

2002-02-24 Thread DL Neil
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

SQL problem?

2002-02-24 Thread Vincent Chen
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

SQL problem?

2002-02-24 Thread Vincent Chen
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

Re: SQL-Problem with three tables and joins

2002-02-13 Thread Kim Kohen
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

SQL-Problem with three tables and joins

2002-02-12 Thread Andreas Habereder
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 |

SQL-Problem with three tables and joins

2002-02-10 Thread Andreas Habereder
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 |

RE: ::grumble:: SQL Problem (bug?) with HAVING clause?

2001-12-19 Thread Carsten H. Pedersen
> 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

::grumble:: SQL Problem (bug?) with HAVING clause?

2001-12-19 Thread Kevin-Neil Klop
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

Re: SQL Problem

2001-11-27 Thread Benjamin Pflugmann
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

SQL Problem

2001-11-22 Thread Manish Mehta
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

Re: SQL Problem

2001-08-29 Thread Adams, Bill TQO
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

SQL Problem

2001-08-29 Thread Morten Søndergaard
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

Re: Challenging SQL Problem

2001-07-01 Thread Bob Hall
>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

Challenging SQL Problem

2001-06-30 Thread PHP Webmaster
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

Re: SQL Problem

2001-05-28 Thread Bob Hall
>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.

RE: SQL Problem

2001-05-28 Thread Lefebvre, Cedric
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

Re: SQL Problem

2001-05-28 Thread oltra jean-michel
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

Re: SQL Problem

2001-05-27 Thread Rolf Hopkins
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

Re: SQL Problem

2001-05-27 Thread Zak Greant
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

SQL Problem

2001-05-27 Thread Lefebvre, Cedric
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

RE: sql problem - it may be a version problem ??

2001-01-24 Thread The Tilghman
> 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

sql problem - it may be a version problem ??

2001-01-24 Thread lrado
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>