Re: simple question on WHERE SELECT query

2004-05-21 Thread Egor Egorov
"adrian Greeman" <[EMAIL PROTECTED]> wrote: > There is a particular form of SQL query you can use I believe when you > are adding data to a table and want to include an ID number from another > lookup table but you only know the name reference and not the ID > > eg it might be an "author" table wi

RE: simple question on WHERE SELECT query

2004-05-21 Thread jonathan.chiu
Adrian, You may try this: INSERT INTO tbl_temp2 (fld_id) SELECT tbl_temp1.fld_order_id FROM tbl_temp1 WHERE tbl_temp1.fld_order_id > 100; Best Regards, Jonathan Chiu OOCL Logistics Unit 1, 4/F., Sun Hung Kai Centre, 30 Harbour Road, Wanchai TEL: 852 . 2990 0174 FAX: 852 . 28249017 -

Re: Simple question : Find older CHILD for each PARENT

2004-01-27 Thread Chuck Gadd
Benjamin PERNOT wrote: I want to get a list of all the parents with the age and the name of the older child they've got. Let's say that a parent can't have 2 children with the same age. I can solve my problem by using multiple queries but that's not very clean and a bit heavy (especially if the

Re: Simple question about updating a table field

2003-11-06 Thread gerald_clark
Yes it is correct, but please don't hijack someone else's thread. Admin-Stress wrote: I have a numeric table field, named "CREDIT". How can I add a number (+50) to that field for all the table record ? is this correct UPDATE ThisTable SET CREDIT=CREDIT+50 Please help, Thanks ___

Re: Simple Question: MySQL and Shell Scripts

2003-06-24 Thread Don Read
On 24-Jun-2003 Fred Whipple wrote: > Don't forget to use '-B' in order to make the output silent except for > the results: > and -N to suppress column names. > 2. you should stick your password (which shouldn't match > your UNIX password) in a textfile readable only by you so that

Re: Simple Question: MySQL and Shell Scripts

2003-06-24 Thread Fred Whipple
Joseph Bueno wrote: Zach wrote: I am writing a shell script using Born Shell. I am trying to get the result of a SQL statement into a variable. For example: /usr/bin/mysql -uroot -prootpass BOB << EOF SELECT * FROM Bobstable WHERE Name=1 EOF How do I get the result into a variable? But this is mor

Re: Simple Question: MySQL and Shell Scripts

2003-06-24 Thread Paul Chvostek
On Mon, Jun 23, 2003 at 06:37:17PM -0500, Zach wrote: > > I am writing a shell script using Born Shell. I am trying to get the result of a SQL > statement into a variable. You mean Bourne shell. > For example: > > /usr/bin/mysql -uroot -prootpass BOB << EOF > SELECT * FROM Bobstable WHERE Name=1

Re: Simple Question: MySQL and Shell Scripts

2003-06-24 Thread Joseph Bueno
Zach wrote: I am writing a shell script using Born Shell. I am trying to get the result of a SQL statement into a variable. For example: /usr/bin/mysql -uroot -prootpass BOB << EOF SELECT * FROM Bobstable WHERE Name=1 EOF How do I get the result into a variable? Thanks in advance! May be: myva

Re: simple question about 3 files become one table

2003-06-06 Thread Paul DuBois
At 16:58 -0400 6/6/03, Vivian Wang wrote: I have three files which are .frm, .MYD and .MYI. How I can use those three files become one table again? Thanks. They already are one table. You don't need to do anything. MySQL implements each MyISAM table using three files. This is normal. -- Paul DuBoi

RE: simple question

2002-11-19 Thread Karuna Bhavnani
order by date_format(mydate,'-mm-dd') desc -Original Message- From: Carter, Scott [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:30 AM To: 'Doug Durham'; '[EMAIL PROTECTED]' Subject: RE: simple question The problem is the command is no

RE: simple question

2002-11-19 Thread Carter, Scott
- From: Doug Durham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 11:59 AM To: Carter, Scott Subject: RE: simple question Since the default ORDER BY is ascending, and you want the most recent first, have you tried ... ORDER BY lastused DESC - Doug At 11:37 AM 11/19/2002 -0600

RE: simple question

2002-11-19 Thread Paul DuBois
At 11:37 -0600 11/19/02, Carter, Scott wrote: There might be ten different records with a fname of scott and the dates might be 2002-11-18, and 2002-11-10 and 2002-10-15. When the query results are returned the ORDER BY clause seems to have no effect on the results. I would want the record with

RE: simple question

2002-11-19 Thread Carter, Scott
queryed I need to show the newest user first. Thanks - Scott Carter -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 19, 2002 9:46 AM To: Carter, Scott; '[EMAIL PROTECTED]' Subject: RE: simple question At 9:06 -0600 11/19/02, Carter, Scott w

RE: simple question

2002-11-19 Thread Paul DuBois
ith "scott" and in what order are they returned? Thanks - Scott Carter -Original Message- From: Paul DuBois [mailto:[EMAIL PROTECTED]] Sent: Monday, November 18, 2002 5:51 PM To: Carter, Scott; '[EMAIL PROTECTED]' Subject: Re: simple question At 17:19 -0600 11/18/02

RE: simple question

2002-11-19 Thread Carter, Scott
nt: Monday, November 18, 2002 5:51 PM To: Carter, Scott; '[EMAIL PROTECTED]' Subject: Re: simple question At 17:19 -0600 11/18/02, Carter, Scott wrote: >I want to sort my results by a date that is contained in the database table >the query is performed on. The ORDER BY clause does

Re: simple question

2002-11-18 Thread Paul DuBois
At 17:19 -0600 11/18/02, Carter, Scott wrote: I want to sort my results by a date that is contained in the database table the query is performed on. The ORDER BY clause does not seem to do the trick. How do you do this? Thanks - Scott Carter With ORDER BY. You'll have to provide more details

RE: RE: Simple Question relating to Indexing

2002-05-05 Thread Svensson, B.A.T. (HKG)
Why do you want to restrict the names to be unique? //Anders - SQL, QUERY -Original Message- From: Shaun Bramley To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] Sent: 3-5-02 20:16 Subject: Re: Simple Question relating to Indexing I'd like to first thank Carl and Anders for

RE: Simple Question relating to Indexing

2002-05-03 Thread Cal Evans
hno-Mage * http://www.calevans.com * -Original Message- From: Shaun Bramley [mailto:[EMAIL PROTECTED]] Sent: Friday, May 03, 2002 1:17 PM To: Svensson, B.A.T. (HKG); [EMAIL PROTECTED] Subject: Re: Simple Question relating to Indexing I'd like to first thank Carl and Anders for your quick

Re: Simple Question relating to Indexing

2002-05-03 Thread Shaun Bramley
Sent: Friday, May 03, 2002 1:11 PM Subject: RE: Simple Question relating to Indexing > > Hello all being relatively new on the SQL scene I must say some of the > > concepts are a little new and strange to me. My really big question is what > > is the difference between an index

RE: Simple Question relating to Indexing

2002-05-03 Thread Svensson, B.A.T. (HKG)
> Hello all being relatively new on the SQL scene I must say some of the > concepts are a little new and strange to me. My really big question is what > is the difference between an index and a key? are the synonamous with each > other? A key will identifying a row or several rows. Just like yo

RE: Simple Question relating to Indexing

2002-05-03 Thread Cal Evans
I'll take a stab at this. A key is a value that you can use in a table and relate it to another table. In this usage you will hear people talk of primary keys and foreign keys. A primary key is a value that uniquely identifies a record in a table. With VERY FEW exceptions, all tables should hav

RE: simple question on joining tables

2002-02-13 Thread Todd Williamsen
Yaniv, Set the field of user_id to INT then make the size 10 or larger, which will produce an ID size of up to 99. Now set it to auto increment then set the user_id field to Primary key, this should solve your problem, if I understand you correctly -Original Message- From: [EMA

RE: simple question?

2002-01-14 Thread Roger Baklund
* Michael Ayres > +---+---+ > | a | b | > +---+---+ > | 1 | 1 | > | 1 | 2 | > | 2 | 2 | > | 3 | 1 | > +---+---+ > > I would like to retrieve the set of all a where b !=2 > so in the above example, only 3 would be returned... Use a LEFT JOIN: SELECT t1.* FROM t1 LEFT JOIN t1 AS t2 ON

Re: Simple question

2001-04-17 Thread B. van Ouwerkerk
At 19:31 17-4-01 +0100, John Dean wrote: >Hi >Did you leave an old version of the shared libs lying around? The old version is packed with PHP.. Bye, B. query sql - Before posting, please check: http://www.mysql.com/manu

Re: Simple question

2001-04-17 Thread John Dean
Hi Did you leave an old version of the shared libs lying around? At 10:16 17/04/2001 +0200, Administrator wrote: >I've installed Mysql server version 3.23.36 from source distribution >(*.tar.gz). When I show the php4 credits () in my browser >it shows: >MySQL Support enabled >Active Persistent Li

Re: Simple question

2001-04-17 Thread B. van Ouwerkerk
>Why it display other version of client api than I install. > >It would be nice that You answer me. Did you compile PHP with --with-mysql=/path/to/mysql Bye, B. - Before posting, please check: http://www.mysql.com/manual

Re: Simple question

2001-02-06 Thread kentj
to the server, it > won't let me in. Do you think I should do that first? > > Thanks for your time > > Joel > - Original Message - > From: kentj <[EMAIL PROTECTED]> > To: Joel Holtzman <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Monday, Fe

Re: Simple question

2001-02-05 Thread kentj
A gui that works on the linux box is kmysql. Joel Holtzman wrote: > Hello, I always wanted a gui interface to use on my win 98 pc to connect > to mysql, and create/edit tables. However, i always get an access denied > error, saying I'm not allowed to connect to the mysql server. > > However,

Re: Simple question

2001-02-05 Thread Tõnu Samuel
Joel Holtzman wrote: > > Hello, I always wanted a gui interface to use on my win 98 pc to connect to mysql, >and create/edit tables. However, i always get an access denied error, saying I'm not >allowed to connect to the mysql server. > > However, via telnet, I am fine. By default MySQL serve