KE '%dadasd%'
> LIMIT 0 , 10
>
> MySQL said:
>
> #1054 - Unknown column 'adman_ad_spaces.campaign_id' in 'on clause'
>
> part of the structure of adman_ad_spaces:
>
>
> Field Type Collation Attributes Null Default Extra Action
> space_
on Attributes Null Default Extra Action
space_id int(10) UNSIGNED No auto_increment
scheme_id int(10) UNSIGNED No 0
campaign_id int(10) UNSIGNED No 0
type enum('Text', 'Banner', 'Rich', 'Text in List') latin1_swedish_ci No Text
as you can see campaign_id cl
SELECT EXISTS(
SELECT * FROM WHERE
)
- Perrin
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Hello,
What is the best method to check if (one or more) row exists (note:
primary key is auto inc and table engine is InnoDB - but what if these
were not true) ?
1) SELECT * FROM WHERE
Check to see if the result set is non-empty.
2) SELECT COUNT(*) AS cnt FROM WHERE
Check to see if the
At 12:00 AM 11/21/2008, you wrote:
In the last episode (Nov 20), mos said:
> At 08:02 PM 11/20/2008, you wrote:
> >Try drop table if exists Tablex;
>
> Ahhh, I don't necessarily want to drop the table if it already
> exists. :) If the table already exists then I'll ad
In the last episode (Nov 20), mos said:
> At 08:02 PM 11/20/2008, you wrote:
> >Try drop table if exists Tablex;
>
> Ahhh, I don't necessarily want to drop the table if it already
> exists. :) If the table already exists then I'll add new rows to it
> (and keep t
At 08:02 PM 11/20/2008, you wrote:
Try drop table if exists Tablex;
Ahhh, I don't necessarily want to drop the table if it already exists. :)
If the table already exists then I'll add new rows to it (and keep the
existing rows). If the table doesn't exist, then I'll cr
Try drop table if exists Tablex;
On Fri, Nov 21, 2008 at 9:53 AM, mos <[EMAIL PROTECTED]> wrote:
> How can I determine if a temporary table exists? Normally I use something
> like:
>
> create temporary table Tablex like Table1;
> show tables like "Tablex";
>
&g
How can I determine if a temporary table exists? Normally I use something like:
create temporary table Tablex like Table1;
show tables like "Tablex";
but the Show Tables never displays any rows for a temporary table even
though the temporary Tablex exists. (All in same thread).
So
All Dear friends
İ am mentioning that 2 different server
one is running on mysql 4.1 (Current) (dumped)
the other is 5.1..xxx (New) (restored)
İ solved my problem in such a way that i droped in my new server mysql and
test databases
mysql> show databases;
+---
>-Original Message-
>From: Jim Lyons [mailto:[EMAIL PROTECTED]
>Sent: Sunday, August 24, 2008 12:00 PM
>To: Deniss Hennesy
>Cc: mysql
>Subject: Re: ERROR 1050 ( ) at line : Table 'columns_priv' already
>exists
>
>correction, the command that
u're getting the error message:
>
> *ERROR 1050 ( ) at line : Table 'columns_priv' already exists*
>
> I assume you're trying to restore the mysql database from a backup and the
> script is trying to re-create the privileges tables. You cannot create a
> tab
The command that's failing evidently is the "drop table columns_priv" which
is why you're getting the error message:
*ERROR 1050 ( ) at line : Table 'columns_priv' already exists*
I assume you're trying to restore the mysql database from a backup and th
> On Fri, Aug 22, 2008 at 6:33 PM, Jim Lyons <[EMAIL PROTECTED]> wrote:
>
>> You're restoring the mysql database itself, do you mean to do this? You
>> probably do if it's a new server but there already exists a mysql database
>> so, unless your restore pro
You're restoring the mysql database itself, do you mean to do this? You
probably do if it's a new server but there already exists a mysql database
so, unless your restore program does "DROP TABLE" before each create, you'll
keep getting this error.
On Fri, Aug 22,
Hi to list
i ve installed new server. while i was restoring my backup to this server.
i took this error and restoring procees is to stop.
*ERROR 1050 ( ) at line : Table 'columns_priv' already exists*
My old server mysql version is mysql-client-4.0.20 is running on old
s
>Maybe what I am seeing in the Query Browser area is in fact a Warning
>message and not an error!!
Ahhh...yes maybe that's it. Just fyi, here is the detail of the warning:
mysql> drop table if exists recipes;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql&
I am certain the SQLBrowser program authors want to hear about this error
It may be due to the fact that MYSQL procedures need to have a different
delimiter
(//) instead of ;
e.g.
use DBNAME;
DROP PROCEDURE IF EXISTS TABLE_NAME;
delimiter //;
Anyone?
Martin
I am getting this problem when I am calling this from within a stored
procedure and from the command line area but from MySQLQueryBrowser
Windows package.
I have tried the DROP TABLE IF EXISTS from the mysql "DOS-type" command
line and it doesn't error - I do notice that (also
can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+---+
| Tables_in_lsldatabase |
+---+
| lslstore |
+---+
1 row in set (0.00 sec)
mysql> drop table if exists recipe
I am finding that
DROP TABLE IF EXISTS mytable;
Works fine if the table exists - but if it doesn't exist I get an error?
Surely it should not error and just not try to drop the table.
Is it me?
I think I sorted it out ...
INSERT INTO master_comments (comment_no,comment_text,language_id)
SELECT comment_no,comment_text,language_id from mComments
WHERE NOT EXISTS
(
SELECT comment_no
FROM master_comments
WHERE mComments.comment_no = master_comments.comment_no
);
Hope this helps someone
Can anyone tell me why this isn't working... v5.0
INSERT INTO master_comments (comment_no,comment_text,language_id)
SELECT comment_no,comment_text,language_id from mComments
WHERE NOT EXISTS (SELECT comment_no FROM master_comments);
I thought I had it working once but now it
On Dec 5, 2007 7:03 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote:
> Sorry I got carried away in my former response.
>
> When I tried this,
> ALTER IGNORE TABLE tbl_name DROP INDEX seems to fail if the index does not
> exist.
Right. ALTER IGNORE means that rows that violate unique indexes won't
b
MySQL?
Googling shows that the "drop index" does not support an "if exists" qualifier
- apparently a bug
has been raised but as far as I know its not fixed yet.
Does anyone know of a work-around?
TIA - Adam
Sent my first response late at night and not the community... And the
r
Fantastic, thanks very much!
Adam
Rob Wultsch wrote:
On Nov 29, 2007 4:34 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote:
Folks
How can one conditionally drop an index in MySQL?
Googling shows that the "drop index" does not support an "if exists" qualifier
-
I actually suggested that last night, and thought better of it because
the alter ignore was so much simpler...
On Dec 3, 2007 11:18 AM, Rolando Edwards <[EMAIL PROTECTED]> wrote:
> You may want to check to see if the index exists first.
> Just query the table INFORMATION_SCHEM
You may want to check to see if the index exists first.
Just query the table INFORMATION_SCHEMA.STATISTICS:
SELECT COUNT(1) FROM INFORMATION_SCHEMA.STATISTICS
WHERE table_schema = ''
AND table_name = ''
AND index_name = '';
This returns the number of columns the
On Nov 29, 2007 4:34 AM, Adam Lipscombe <[EMAIL PROTECTED]> wrote:
> Folks
>
>
> How can one conditionally drop an index in MySQL?
>
> Googling shows that the "drop index" does not support an "if exists"
> qualifier - apparently a bug
> has
Folks
How can one conditionally drop an index in MySQL?
Googling shows that the "drop index" does not support an "if exists" qualifier - apparently a bug
has been raised but as far as I know its not fixed yet.
Does anyone know of a work-around?
TIA - Adam
--
MySQL
Are you sure that's the exact query and error message? The query has a
backtick; the error message has none, which is unusual for a purely
syntactic error. It makes me suspicious that the error is coming from
something else: maybe a subtly mangled file.
I found the problem. When I ran the M
Hi,
Jesse wrote:
I'm attempting to restore a couple of backups, and part way through, I
get the error:
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'IF EXISTS
alumni' at line 1
Query is:
I'm attempting to restore a couple of backups, and part way through, I get
the error:
You have an error in your SQL syntax; check the manual that corresponds to
your MySQL server version for the right syntax to use near 'IF EXISTS
alumni' at line 1
Query is: DROP TRIGGER IF
Hi
Im contructing a build script and would like to dump my dev db with
mysqldump so I can run a deploy script on the production server with the
update db.
I would like to construct the script so that it updates existing
tables/fields/posts and add new tables/fields/post if they do not exists
@lists.mysql.com
Subject: Re: WHERE (NOT) EXISTS problem
Michael Fischer wrote:
> Having a very bad time with the subject sorts of queries.
> Here is a simple reproduction of the problem for me.
> Perhaps I'm blind/stupid while looking at the docs,
> or there's a bug...
>
> m
PM
To: mysql@lists.mysql.com
Subject: WHERE (NOT) EXISTS problem
Having a very bad time with the subject sorts of queries.
Here is a simple reproduction of the problem for me.
Perhaps I'm blind/stupid while looking at the docs,
or there's a bug...
mysql version 5.0.24-standard
sim
real app in development, so...
mysql> SELECT distinct name
FROM people WHERE EXISTS
(select * from people_city_map where cid = 1);
+-+
| name|
+-+
| michael |
| daniel |
| glenn |
| susan |
| lisa|
| reggie |
+-+
Huh? Shouldn't that be limi
mysql> SELECT distinct name
> FROM people WHERE EXISTS
> (select * from people_city_map where cid = 1);
+-+
| name|
+-+
| michael |
| daniel |
| glenn |
| susan |
| lisa|
| reggie |
+-+
Huh? Shouldn't that be limited to the people mapped
Thanks
What I am getting at is: does the "IF EXISTS" qualifier work in this context?
I have an index that is present in some DB's but not in others. I want to run a generic script to
upgrade them all. I don't want the script to stop if the index is not present.
Thanks
Hello Adam,This is the exact syntax to drop the index.DROP INDEX index_name
ON tbl_nameThanksVisolve DB Team .
- Original Message -
From: "Adam Lipscombe" <[EMAIL PROTECTED]>
Cc:
Sent: Friday, September 01, 2006 3:28 PM
Subject: Drop Index if Exists
Folks,
Does this
Folks,
Does this work in MYSQL 5?
I tried "DROP INDEX [NAME] IF EXISTS;" and got an error "check your syntax".
Thanks - Adam
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Neil Tompkins wrote:
Using this query seems to hang my computer and mySQL server reported the
queries had been LOCKED.
How many records are in each table?
It could take a while, especially if you don't have indexes on the join
fields.
--
MySQL General Mailing List
For list archives: http:/
Using this query seems to hang my computer and mySQL server reported the
queries had been LOCKED.
> Date: Mon, 21 Aug 2006 11:09:35 +0200> From: [EMAIL PROTECTED]> To: [EMAIL
> PROTECTED]> CC: mysql@lists.mysql.com> Subject: Re: Return list where no data
> exists> >
Hi Neil,
what you need is a LEFT JOIN:
SELECT a.*
FROM TableA a
LEFT JOIN TableB b ON a.ID = b.ID (assuming ID is what you relate the
tables on )
WHERE b.ID IS NULL;
should hopefully do what you want.
/Johan
Neil Tompkins skrev:
Hi,
I've two tables. What q
Hi,
I've two tables. What query do I need to use to get a list of all records from
table A where table B doesn't contain a a mathing record. For example
TableA
ID
Name
TableB
Date
ID
Name
Thanks
Neil
_
Be one of the first to
Paul,
>> > > I am doing queries that produce a table that looks
something like this:
>> > >
>> > > Count | IP Address | First Seen | Last
Seen | Days
>> > > 5000 10.0.0.1 2005-12-10
2006-04-15 50*
>> > > 6500 10.0.0.2 2006-04-01
2006-04-06
--- Paul Halliday <[EMAIL PROTECTED]> wrote:
> On 4/23/06, John Hicks <[EMAIL PROTECTED]> wrote:
> > Paul Halliday wrote:
>
> > > I am doing queries that produce a table that looks something like
> this:
> > >
> > > Count | IP Address| First Seen| Last Seen | Days
> > > 5000
On 4/23/06, John Hicks <[EMAIL PROTECTED]> wrote:
> Paul Halliday wrote:
> > I am doing queries that produce a table that looks something like this:
> >
> > Count | IP Address| First Seen| Last Seen | Days
> > 5000 10.0.0.1 2005-12-102006-04-15 50*
> > 6500
I am doing queries that produce a table that looks something like this:
Count | IP Address| First Seen| Last Seen | Days
5000 10.0.0.1 2005-12-102006-04-15 50*
6500 10.0.0.2 2006-04-012006-04-06 3**
*So of the 5000 events "count(*) bet
Paul Halliday wrote:
I am trying to formulate a query that will increment if a condition is true.
For example, if I do a select (just let me know if there was data on
this day, if so increment count by 1 and check the next day) where
timestamp between jan and feb.
Could you be a bit more speci
I am trying to formulate a query that will increment if a condition is true.
For example, if I do a select (just let me know if there was data on
this day, if so increment count by 1 and check the next day) where
timestamp between jan and feb.
Thanks.
--
MySQL General Mailing List
For list archi
triggers there? But I was
> thinking if the CREATE DATABASE and CREATE TABLE have a IF NOT EXISTS
> functionality, why should the triggers be any different? Maybe this is
> just an oversight, maybe the CREATE TRIGGER should have a IF NOT EXISTS
> functionality also? or I'm just doing s
E and CREATE TABLE have a IF NOT EXISTS
functionality, why should the triggers be any different? Maybe this is
just an oversight, maybe the CREATE TRIGGER should have a IF NOT EXISTS
functionality also? or I'm just doing something very wrong.
Maybe someone can point me in the right
ernatively, you could try it yourself and see that it fails.
-Sheeri
On 4/7/06, Adrian Co <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Sorry if I wasn't very clear with my question. I was hoping to obtain
> the functionality such that I could do something similar to:
>
> CREATE
Hi,
Sorry if I wasn't very clear with my question. I was hoping to obtain
the functionality such that I could do something similar to:
CREATE TRIGGER IF NOT EXISTS
Because I usually get a trigger already exists in my script. I might be
missing something.
The script basically doe
ts.mysql.com
Subject: Determining if a trigger exists
Hi,
Whats the simplest way to determine if a trigger already exists?
i.e. For tables you have: CREATE TABLE IF NOT EXISTS ...
Is there a way to do
CREATE TRIGGER IF NOT EXISTS
I'm using MySQL 5.0 btw.
Thanks!
Regards,
Adrian
--
M
Hi,
Whats the simplest way to determine if a trigger already exists?
i.e. For tables you have: CREATE TABLE IF NOT EXISTS ...
Is there a way to do
CREATE TRIGGER IF NOT EXISTS
I'm using MySQL 5.0 btw.
Thanks!
Regards,
Adrian
--
MySQL General Mailing List
For list archives:
wrote:
> To: mysql@lists.mysql.com
> From: Rithish Saralaya <[EMAIL PROTECTED]>
> Subject: RE: error 1016 : cant open ibd file even though it exists
>
> Hello Keith.
>
> The power outage was known before-hand, and the server was
> shutdown before the outage happened. The serve
ling references it has to any db/table?
Regards,
Rithish.
-Original Message-
From: Heikki Tuuri [mailto:[EMAIL PROTECTED]
Sent: Monday, February 27, 2006 1:54 PM
To: mysql@lists.mysql.com
Subject: Re: error 1016 : cant open ibd file even though it exists
Rithish,
- Original Mes
]
Sent: Saturday, February 25, 2006 8:13 PM
To: mysql@lists.mysql.com
Subject: RE: error 1016 : cant open ibd file even though it exists
I do not use Innodb tables at the moment, so all this is
pure speculation.
Is/was the server connected to a UPS when the power failure
happened?
If so, did the
Rithish,
- Original Message -
From: ""Rithish Saralaya"" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Monday, February 27, 2006 7:06 AM
Subject: RE: error 1016 : cant open ibd file even though it exists
Heikki.
I found the ibdata1 and ib
om
Subject: Re: error 1016 : cant open ibd file even though it exists
Rithish,
ok, then the most probable explanation is that someone had edited my.cnf
earlier, when mysqld was running. When mysqld was restarted, it read the new
my.cnf, and got confused.
Please ask your sysadmins to scan the file
RE: error 1016 : cant open ibd file even though it exists
>
> Hello David.
>
> There was supposed to be a power outage in our office that day. So the
> server was shut down. Finally when the power was back, the machine was
> plugged on. That's all. No file system change. No
ot;Rithish Saralaya"" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Saturday, February 25, 2006 12:14 PM
Subject: RE: error 1016 : cant open ibd file even though it exists
--=_NextPart_000_001D_01C63A22.BB0C91A0
Content-Type: text/plain;
charset="Windows-
EMAIL PROTECTED]
Sent: Saturday, February 25, 2006 3:32 PM
To: Rithish Saralaya
Cc: mysql@lists.mysql.com
Subject: Re: error 1016 : cant open ibd file even though it exists
Hi Rithish,
After reading Heikkis points, I am inclined to agree. Did your sysadmins
change a filesystem durin
ven though it exists
Rithish,
from the .err log we see that mysqld was shut down for 12 hours on Feb 19th.
What did the sysadmins do during that time?
There are two plausible explanations:
1) they edited datadir in my.cnf to point to a different location (
/var/lib/mysql),
or
2) they remov
riday, February 24, 2006 3:55 PM
To: mysql@lists.mysql.com
Subject: Re: error 1016 : cant open ibd file even though it exists
Rithish,
from the .err log we see that mysqld was shut down for 12 hours on Feb 19th.
What did the sysadmins do during that time?
There are two plausible explanations:
1)
/order.php
- Original Message -
From: ""Rithish Saralaya"" <[EMAIL PROTECTED]>
Newsgroups: mailing.database.myodbc
Sent: Friday, February 24, 2006 6:55 AM
Subject: RE: error 1016 : cant open ibd file even though it exists
Hello.
The tables were working perfe
:
> To: MySQL general mailing list
> From: Rithish Saralaya <[EMAIL PROTECTED]>
> Subject: RE: error 1016 : cant open ibd file even though it exists
>
> Hello.
>
> The tables were working perfectly fine a week back. The database was created
> from a sql file generated
06 7:52 PM
To: mysql@lists.mysql.com
Subject: Re: error 1016 : cant open ibd file even though it exists
Rithish,
the table definition does not exist in the ibdata file. You have the
.frm file and the .ibd file, but that does not help if the table
definition is not stored in the ibdata file.
How di
/lib/mysql/ This is where the mysql is located. That's
proper.
-Original Message-
From: sheeri kritzer [mailto:[EMAIL PROTECTED]
Sent: Friday, February 24, 2006 3:22 AM
To: Rithish Saralaya
Cc: MySQL general mailing list
Subject: Re: error 1016 : cant open ibd file even though it exi
base works fine.
>
> ERROR 1016 (HY000): Can't open file: 'TBL_FORUM_MSG_BODY.ibd' (errno: 1)
>
> However, I have noticed that both the .frm and the .ibd file exists for the
> table TBL_FORUM_MSG_BODY. Then why the error? I looked into the error log
> and it is as follows
>
&g
1016 : cant open ibd file even though it exists
From: "Rithish Saralaya"
Date: 2006-02-22 11:27:44
Message-ID: ANEAKJJGBMNHIAEBLIAIMEPCECAA.rithish.saralaya ()
tallysolutions ! com
[Download message RAW]
Hello.
I get the following error when I try to query a table in a
Original Message-
From: Ady Wicaksono [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 23, 2006 5:50 PM
To: Logan, David (SST - Adelaide)
Cc: Rithish Saralaya; MySQL general mailing list
Subject: Re: error 1016 : cant open ibd file even though it exists
Try to help
Please give us the "l
ursday, 23 February 2006 5:02 PM
To: Logan, David (SST - Adelaide); MySQL general mailing list
Subject: RE: error 1016 : cant open ibd file even though it exists
Hello David. Thanks for the prompt response.
The permissions were the first thing that I checked when I got the
error. In
fact, I
al Message-
From: Rithish Saralaya [mailto:[EMAIL PROTECTED]
Sent: Thursday, 23 February 2006 5:02 PM
To: Logan, David (SST - Adelaide); MySQL general mailing list
Subject: RE: error 1016 : cant open ibd file even though it exists
Hello David. Thanks for the prompt response.
The permissions were
PROTECTED]
Sent: Thursday, February 23, 2006 10:42 AM
To: Rithish Saralaya; MySQL general mailing list
Subject: RE: error 1016 : cant open ibd file even though it exists
Hi Rithish,
Please check your ownership/permissions
hambone ~ $ perror 1
OS error code 1: Not owner
hambone ~ $
Regards
ever, I have noticed that both the .frm and the .ibd file exists for the
table TBL_FORUM_MSG_BODY. Then why the error? I looked into the error log
and it is as follows
060222 15:14:09 InnoDB error:
Cannot find table test/TBL_FORUM_MSG_BODY from the internal data dictionary
of InnoDB though the .frm
[mailto:[EMAIL PROTECTED]
Sent: Thursday, 23 February 2006 3:43 PM
To: MySQL general mailing list
Subject: error 1016 : cant open ibd file even though it exists
Hello.
I get the following error when I try to query a table in a particular
database (test). The error is generated for all tables within
ever, I have noticed that both the .frm and the .ibd file exists for the
table TBL_FORUM_MSG_BODY. Then why the error? I looked into the error log
and it is as follows
060222 15:14:09 InnoDB error:
Cannot find table test/TBL_FORUM_MSG_BODY from the internal data dictionary
of InnoDB though the .frm
I appreciate the suggestion, but I'm not looking to drop anything. I
only want it as a safety net in the event that the table doesn't
already exist. I'm doing syncing of sorts, and I want the CREATE
TABLE IF NOT EXISTS so as not to throw errors in the event that the
table
DROP TABLE IF NOT EXISTS?
On 1/16/06, Michael Williams <[EMAIL PROTECTED]> wrote:
>
> Hi All,
>
> Having a bit of mysqldump trouble again. I've looked over the
> documentation (again) and can't seem to find the flag to make
> 'mysqldump' out pu
Hi All,
Having a bit of mysqldump trouble again. I've looked over the
documentation (again) and can't seem to find the flag to make
'mysqldump' out put "CREATE TABLE IF NOT EXISTS". Any ideas?
Regards,
Michael
--
MySQL General Mailing List
For list ar
IKE '%Machico%'
If this works, try deleting and re-inserting the row.
I've had a similar situation in the past.
Hope this helps,
Paul
-Original Message-
From: Wenca [mailto:[EMAIL PROTECTED]
Sent: 27 October 2005 10:56
To: mysql@lists.mysql.com
Subject: Record exists bu
Wenca wrote:
SELECT * FROM tab_p WHERE d_id = 20602 AND name LIKE 'Machico'
-> no results
Try it with ...AND `name` LIKE '%Machico%';
I have encountered it once when there were non printable characters in
front of or after the text itself. Very frustrating!
You can see what extra characters
Hi all,
I've got a problem that I don't understand and that is driving me mad.
I have a table 'tab_p' with this structure:
nametype
---
p_idmediumint(8) AUTOINCREMENT NOT NULL PRIMARY KEY
d_idsmallint(5) NOT NULL
namevarchar(50) NOT NULL
An
> Maybe you could use
>
> SHOW TABLES LIKE 'your_table';
That's a great idea, I just tried it in several ways, like:
IF EXISTS (SHOW TABLES LIKE 'cfgbiz') THEN
SELECT siacnotifyto FROM cfgbiz
ELSE
SELECT '' as siacnotifyto
END IF;
On Thursday 06 October 2005 10:57 am, Ryan Stille wrote:
> I am converting some code from MSSQL to MySQL. In one place I need to
> have a conditional query depending on if a table exists or not. There
> are different versions of this application and the table only exists in
> some of
Ryan Stille wrote:
If I have to, I could resort to doing another query in my application
(SHOW TABLES) and seeing if my table was returned in that list. But I
was hoping for a more elegant way to do it, within the single query.
Maybe you could use
SHOW TABLES LIKE 'your_table';
--
Keith
> If 'SHOW COLUMNS FROM tablename' returns error 1146 (42S02), the
> table doesn't exist.
This causes my application (ColdFusion) to throw an exception.
If I have to, I could resort to doing another query in my application
(SHOW TABLES) and seeing if my table was returned in that list. But I
wa
Ryan,
>I am converting some code from MSSQL to MySQL. In one place I need to
>have a conditional query depending on if a table exists or not. There
>are different versions of this application and the table only exists in
>some of them. Here is how it was done in MSSQL:
If '
I am converting some code from MSSQL to MySQL. In one place I need to
have a conditional query depending on if a table exists or not. There
are different versions of this application and the table only exists in
some of them. Here is how it was done in MSSQL:
IF OBJECT_ID('cfgbiz') I
Hello.
You can parse the output of 'SHOW CREATE TABLE' or 'SHOW COLUMNS'. See:
http://dev.mysql.com/doc/mysql/en/show-columns.html
http://dev.mysql.com/doc/mysql/en/show-create-table.html
Claire Lee wrote:
> I want to check if a column exists in a table
Hi,
2005/9/26, Peter Brawley <[EMAIL PROTECTED]>:
> Claire,
>
> >I want to check if a column exists in a table before I
> >do an alter table to add it. How do I do this in
> >mysql? Thanks.
other solution, do your query in all case and check for the return
erro
Claire,
>I want to check if a column exists in a table before I
>do an alter table to add it. How do I do this in
>mysql? Thanks.
If you are using MySQL 5.0, query information_schema.columns
(http://dev.mysql.com/doc/mysql/en/columns-table.html) for the table and
column. Otherwise
Dyego Souza Dantas Leal wrote:
Hello Guys,
I'm using the 5.0.12 version of MySQL PRO on AMD64 3000+ with 1 GB of
ram and using the InnoDB Tables..
Here is the Select:
mysql> select f1.fc_package from svcs_filecontrol f1 where f1.fc_id in (
-> *select max(f2.fc_id) from svcs_filecontr
I want to check if a column exists in a table before I
do an alter table to add it. How do I do this in
mysql? Thanks.
Claire
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
MySQL
Hello Guys,
I'm using the 5.0.12 version of MySQL PRO on AMD64 3000+ with 1 GB of
ram and using the InnoDB Tables..
Here is my table:
CREATE TABLE `svcs_filecontrol` (
`fc_id` int(10) unsigned NOT NULL auto_increment,
`fc_us_id_lockby` int(10) unsigned default NULL,
`fc_lbl_id` int(10) un
Hi,
> Now as expected it's an dependent subquery and makes use of the index on
> document_id. BUT: If we change the "SELECT id" in the subquery to
> "SELECT document_id" or "SELECT 1", we get:
>
> *** 1. row ***
> [...]
> **
Hi all,
the manual says:
"If a subquery returns any rows at all, then EXISTS subquery is TRUE,
and NOT EXISTS subquery is FALSE. ... Traditionally, an EXISTS subquery
starts with SELECT *, but it could begin with SELECT 5 or SELECT column1
or anything at all. MySQL ignores the SELECT li
1 - 100 of 334 matches
Mail list logo