On 8/5/06, Karl Larsen <[EMAIL PROTECTED]> wrote:
I am using Linux called Fedora Core 4. I had no problem getting
mysql 4 working here and liked it a lot. But when I discovered 4 doesn't
have VIEW but 5 does I have tried several RPM sets of 5 that fail for
basic reasons. The reasons are the w
On Fri, 2006-08-04 at 17:14 -0700, Tanner Postert wrote:
> select text from table where user = 2 and id < 3 order by id ASC limit 1;
> select text from table where user = 2 and id > 3 order by id ASC limit 1;
>
> is it possible to do this using 1 query?
select text from table
where user = 2 and
I've thought about this a bit more since last night, and it seems that I can
just use the built in 'CURRENT_DATE' (sp?) as it's a given that if they're
logged in, then they're logged in NOW() which is == CURRENT_DATE minus the
hh:mm:ss.
I guess I could also store in a session (this is in PHP) the
You could add an extra field called last_login_date which you'd set only
once per session - at login time. At login time you'd set this to the
value that exists in login_date. Then use that for comparison against
created_on.
Daevid Vincent wrote:
I have a SQL challenge I'm not sure how to sol
so i have a record set:
id user text
1 2 ...
2 6 ...
3 2 ...
4 4 ...
5 2 ...
6 8 ...
7 1 ...
8 8 ...
9 2 ...
so lets say I am looking at record 3. i need to know the previous record in
the table that has that user, as well as the next record in the table that
has that user.
r
I have a SQL challenge I'm not sure how to solve. But it's so common, I feel
kind of stupid asking this...
I have a 'user' table with 'login_date' which is an auto updated DATETIME
column and a 'created_on' which is a DATETIME (but not updated after the
record is created the first time)
I want to
I think this only works if I "know" that "Orange" is the default value.
For example if "Orange" is the default and I am searching for "Blue" I
will have to use a different query. Since I don't know the default (its
in the type table) I would have to do two queries. How about something
like this?
S
Well, I said earlier that if I found a solution to this, I'd post it. Here
it is, with many thanks to Nicholas Bernstein's timely July 7 post to the
doc on user variables:
It's not particularly elegant, it just gets the job done. If there is a
cleaner way to do this, I'm not ashamed to be e
I am using Linux called Fedora Core 4. I had no problem getting
mysql 4 working here and liked it a lot. But when I discovered 4 doesn't
have VIEW but 5 does I have tried several RPM sets of 5 that fail for
basic reasons. The reasons are the wrong libraries or they are missing
in total :-)
On Fri, 2006-08-04 at 15:54 -0400, Ed Pauley II wrote:
> I am looking into a scale-out solution for MySQL. I have read white
> papers and searched the web but I can't find a load balancer that claims
> to work well for MySQL. MySQL's white paper shows NetScaler in the
> scale-out stack but noth
I should mention that the below concerns read-only daemons, Dan's post
reminded me of that. Having multiple masters in a load balanced
environment is extremely difficult to do right.
I would wager that for most applications, at least internet related,
you'll have a much higher read-to-write ratio
On Friday 04 August 2006 11:26 am, Daniel da Veiga wrote:
> Think better before you hit "send".
Dude
> --
--
Chris White
PHP Programmer/DBarn
Interfuel
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
If you're using Myphpadmin, you can turn this option off when generating the
dump file.
-Original Message-
From: Chris White [mailto:[EMAIL PROTECTED]
Sent: Friday, August 04, 2006 12:14 PM
To: mysql@lists.mysql.com
Subject: Re: Backup SQL
On Friday 04 August 2006 10:35 am, Daniel da Vei
I have an unexplained crash I am trying to figure out.
This is a pretty static system, that has been running fine for a couple years.
It crashed at 7:45am which is after any nightly bakups have all been done, so
not even under any load. All other aspects of the system such as i/o,ram,cpu,
number
I have two databases that effect each other when triggers get excecuted.
There is a schedules database that updates registration database. The
problem I have is with the enrolled, attended, waitlisted, completed,
cancelled, etc. booleans values. The registration db has triggers on it that
enforce
Ed, in Jeremy Zawodny's (excellent) book "High Performance MySQL",
there is a chapter on load balancing - though it's a bit more of a
theoretical discussion than a how-to.
There are a couple of commercial products mentioned briefly - Veritas
and EMIC Networks.
One idea he presents might work for
You can have a simple LVS setup running with a plugin from Nagios,
check_mysql, which will connect to the mysql daemon and run a status
query. If you want anything more than that you most likely will have to
write a custom check plugin (shouldn't be that hard). LVS works nicely as
a mysql loadbalan
Thanks Nestor!
I think I am almost there. However, how can I limit the result of a
JOIN in a query, and not the entire result set? For example:
SELECT
*
FROM
a
JOIN
b
ON
a.id = b.id
If I wanted all records from "a" and only the first record from "b", how
would I integrate a LIM
I am looking into a scale-out solution for MySQL. I have read white
papers and searched the web but I can't find a load balancer that claims
to work well for MySQL. MySQL's white paper shows NetScaler in the
scale-out stack but nothing on Citrix.com mentions MySQL. I also read
that friendster
How about:
SELECT DISTINCT `key`, COUNT(`key`) AS c
FROM `table` WHERE `value` in (8,9,10)
HAVING c=3;
Clever! Thanks :-)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Thanks Nestor,
I thought about that, but limit 1 doesn't work in my scenario as I want
to access both the FIRST() and LAST() column for a result set
simultaneously. By telling MySQL to limit to 1, I could get the first,
but not the last. I want mysql to give me the first, drop everything in
Morten wrote:
Hi,
Given the table keyval(key int(11), val int(11)), I would like to be
able to retrieve the keys for which a row exist for given X values.
Example:
key value
18
19
110
28
38
310
48
49
410
411
Given values 8, 9, 10 the query should t
Morten wrote:
Hi,
Given the table keyval(key int(11), val int(11)), I would like to be
able to retrieve the keys for which a row exist for given X values.
Example:
key value
18
19
110
28
38
310
48
49
410
411
Given values 8, 9, 10 the query should t
Peter Brawley wrote:
>Can this be expressed somewhat more elegantly than multiple EXISTS
subqueries?
>SELECT DISTINCT key FROM keyval outer
>WHERE EXISTS (SELECT * FROM keyval inner
>WHERE outer.key = inner.key
>AND inner.val = 8)
>AND EXISTS (SELECT * FROM keyval inner
>WHE
I just noticed that MSAccess and SQL server support FIRST() and LAST()
functions. Is there an equivalent in MySQL? My research has come up
with nil so far.
Thanks,
Michael
Michael Caplan wrote:
Hi there,
I am trying to figure out how to "flatten" the result set of a join
query using aggr
Hi there,
I am trying to figure out how to "flatten" the result set of a join
query using aggregate functions. For several fields (b.refering_url,
c.string, b.first_page, b.last_page) I need to pull out the _first_ or
_last_ item as ordered from the records returned from the join.
However,
Hi,
I just saw your e-mail.
We use mysqldump on solaris 9 with large files all the time. Is the
partition you are writng the file to mounted with the largefiles
option in /etc/mnttab?
Our mysql dump files are 25 gig.
Ken
- Original Message -
From: "Duhaime Johanne" <[EMAIL PROT
>Can this be expressed somewhat more elegantly than multiple EXISTS
subqueries?
>SELECT DISTINCT key FROM keyval outer
>WHERE EXISTS (SELECT * FROM keyval inner
>WHERE outer.key = inner.key
>AND inner.val = 8)
>AND EXISTS (SELECT * FROM keyval inner
>WHERE outer.key = inner.key
>
This might help you
http://kjalleda.googlepages.com/maxconnbymysql
Kishore Jalleda
On 8/2/06, Rithish Saralaya <[EMAIL PROTECTED]> wrote:
Hello folks.
How do I determine what is the safest value that I can set for
max_connections in my.cnf? The default value of 100 is proving to be a
shortfal
Hi,
Given the table keyval(key int(11), val int(11)), I would like to be
able to retrieve the keys for which a row exist for given X values.
Example:
key value
18
19
110
28
38
310
48
49
410
411
Given values 8, 9, 10 the query should thus return 1 an
On 8/4/06, Chris White <[EMAIL PROTECTED]> wrote:
On Friday 04 August 2006 10:35 am, Daniel da Veiga wrote:
> What if each .sql contains a "DROP TABLE IF EXISTS" statement at the
> start? Something to be carefull if its the program that generated the
> backup likes to add this tags.
What if my w
On Friday 04 August 2006 10:35 am, Daniel da Veiga wrote:
> What if each .sql contains a "DROP TABLE IF EXISTS" statement at the
> start? Something to be carefull if its the program that generated the
> backup likes to add this tags.
What if my website code breaks? This train of "what if" type qu
I didn't say consider a table with a thousand rows, must have been someone elses response. But anyway, it comes down to knowing your
data. If you know your data, then you can create the best set of indexes.
I would almost never create an index on a field with a cardinality of 2. However, I would
On 8/4/06, Chris White <[EMAIL PROTECTED]> wrote:
On Friday 04 August 2006 04:04 am, Kaushal Shriyan wrote:
> mysql -u kaushal -h example.com -p drupal <
> /home/kaushal/drupal/new/a-l.sql and then do
> mysql -u kaushal -h example.com -p drupal <
> /home/kaushal/drupal/new/m-s.sql
Better would b
Brent,
Given that...
You really have to match cardinality with distribution of values.
...sounds like hard work (well you actually have to think about it) and...
considering all the above cases, what should I conclude? should I have
indexes on these three fields?
Looking for a specific answe
At 1:00 +0200 4/8/06, Johan Höök wrote:
what you can do is:
SELECT [fields]
FROM [table]
WHERE id IN (id1,id2,id3...)
ORDER BY FIELD([field],value1,value2,value3,...)
Ooh - so I can. I didn't know that wrinkle for
order by - though I did wonder if something like
that should be possible.
Th
It depends on the data, not the situation. How's that?
FLD_4 is doubtful that you would want/need and index on it. This assumes an even distribution of both values (ie. male/female).
Since you would be scanning half the table anyway, an index won't really help. Now if it's not an even distributi
Greetings,
I need help with a select statement that finds duplicate sets of rows.
I have a table like so:
batch_data
---
ID - int (auto inc)
Record ID - int
DataValue - VarChar(99)
DataType - int
With a sample of data like this:
1 100 1122A 1
2 100 1350G 1
3
On Friday 04 August 2006 04:04 am, Kaushal Shriyan wrote:
> mysql -u kaushal -h example.com -p drupal <
> /home/kaushal/drupal/new/a-l.sql and then do
> mysql -u kaushal -h example.com -p drupal <
> /home/kaushal/drupal/new/m-s.sql
Better would be:
mysql -u kaushal -h example.com -p drupal < ~/dr
Bruce,
i had initially thought that i could have the following tbl structure:
UniversityTBL (
name
ID auto_increment,
)
In a generic kinda "Best Practice", things I've picked up from various
places way I'd recommend the following things: -
1) The first field always be the Primary Key an
hi peter.
i've got a couple of logic/layout questions that i'm grappling with. hope
you don't mind my posting.
i've had some responses from a few people on the icr/mysql but i'm not sure
as to their level of mysql usage/skill.
my test app is used to build a system of college class schedules. i w
Hi,
I am replying back to my own post. Sorry, I forgot to mention that I
am using mysql client on WinXP Pro SP2 and MySQL-5.0.22 is installed
on the same machine.
Any hints as to why mysql client is showing this behavior?
Thanks in advance,
--
Asif
On 8/4/06, Asif Lodhi <[EMAIL PROTECTED]> w
On 8/1/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
I filed bug #20941 (mysqld seg faults during instance configuration on
XP pro, http://bugs.mysql.com/?id=20941) some time ago and have seen no
real movement on fixing it. I'm dead in the water. I can't get MySQL
v5.0 to work on my system.
Hi,
In my stored procedures, i want to ROLLBACK when I encounter any
invalid values. However, as it happens, I cannot because MySQL does
not support COMMIT/ROLLBACK functionality right now (as of ver. 5.0.22
on WinXP Pro). I am setting session variables (Set @XX="Error
Message') according ot ea
Hi,
When I create scripts, I change the delimiter at the beginning of the
create_table script from ";" (without quotes) to "//". At the end of
the script, I change the delimiter back to the original ";". This is
according to what is described in doc at www.mysql.com.
However, when I run these
Is this list still working ?
Mickalo
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi
I have a query is i have taken backup from druapl due to timeout error
in three backup files
a-l.sql
m-s.sql
t-z.sql
Now my understanding is if i do
mysql -u kaushal -h example.com -p drupal < /home/kaushal/drupal/new/a-l.sql
and then do
mysql -u kaushal -h example.com -p drupal < /home/kau
Hi Chris,
what you can do is:
SELECT [fields]
FROM [table]
WHERE id IN (id1,id2,id3...)
ORDER BY FIELD([field],value1,value2,value3,...)
/Johan
Chris Sansom skrev:
Yes, I have looked at the docs and can't find what I'm looking for.
I'm doing a very simple query:
SELECT [fields]
FROM [table]
Yes, I have looked at the docs and can't find what I'm looking for.
I'm doing a very simple query:
SELECT [fields]
FROM [table]
WHERE id IN (id1,id2,id3...)
Is there a way to return the results in the order they appear in the IN list?
I'm sure there's something obvious and simple, but as a rel
Hello all,
I have a doubt on Index Merge.
We are currently using MySQL server 4.1.11. As a part of DB management I am
currently doing an analysis on all the Tables.
While looking into the table structures, their columns and Indexes I found that
most of the tables have an Index on fields that
Have you considered reading up on basic database management?
There are plenty of good material on the web for you to read where you
can actually learn how to manage databases, so you don't have to ask
others about every single detail.
Ratheesh K J wrote:
Hello all,
Another question on card
Hello all,
Another question on cardinality.
Consider a table with 1000 rows and columnns. Details of the columns are as
below:
FLD_1 - int - cardinality 1000 - PRIMARY KEY
FLD_2 - tinyint- cardinality 400
FLD_3 - varchar - cardinality 10
FLD_4 - varchar - cardinality 2
FLD_5 - varchar - ca
Helo all,
Just wanted to know when should a Table be considered for partitioning ( or
should it be archiving ).
Almost all of our tables are of Innodb type. I am looking for an estimate
rather than a "Depends on situation" kind of an answer.
We have few of our table swhich are very huge ( in t
Daevid Vincent wrote:
I posted this as a comment on the page too, but I’m curious as to why the
top solution is off by a day or so... Is this a bug or a rounding issue or
what? Is there a way to "fix" the top one to work the way I expect/want it
to work? I suspect it's because (as Jack Palance sa
I posted this as a comment on the page too, but Im curious as to why the
top solution is off by a day or so... Is this a bug or a rounding issue or
what? Is there a way to "fix" the top one to work the way I expect/want it
to work? I suspect it's because (as Jack Palance said in 'City Slickers')
"
Hello all,
Need an explanation for this:
I did the following -
SELECT DISTINCT COLUMN1 FROM TBL_XXX ;
I got the foll result
1
2
3
4
5
7
8
10
11
12
13
14
16
17
18
19
20
21
23
24
25
26
27
28
29
30
--
56 matches
Mail list logo