Hello,
On 4/17/2019 10:29 AM, Turritopsis Dohrnii Teo En Ming wrote:
Subject/Topic: How do I determine if versions of phpMyAdmin before 4.8.5 is SQL
Injectable using sqlmap?
Good evening from Singapore,
Our customer (company name is Confidential/not disclosed) reported that their
MySQL
Subject/Topic: How do I determine if versions of phpMyAdmin before 4.8.5 is SQL
Injectable using sqlmap?
Good evening from Singapore,
Our customer (company name is Confidential/not disclosed) reported that their
MySQL database has been found missing or was deleted a few times. They are
using
--databases, methinks.
- Original Message -
From: Daevid Vincent dae...@daevid.com
To: mysql@lists.mysql.com
Sent: Thursday, 21 November, 2013 10:44:39 PM
Subject: How do I mysqldump different database tables to the same .sql file?
I'm working on some code where I am trying
There is a good reason that the USE database is not output in those dumps..
it would make the tool very difficult to use for moving data around.
If I might suggest, a simple workaround is to create a shell script along
these lines.. you might to do something a little more sophisticated.
do I mysqldump different database tables to the same .sql
file?
There is a good reason that the USE database is not output in those
dumps..
it would make the tool very difficult to use for moving data around.
If I might suggest, a simple workaround is to create a shell script along
I'm working on some code where I am trying to merge two customer accounts
(we get people signing up under different usernames, emails, or just create
a new account sometimes). I want to test it, and so I need a way to restore
the data in the particular tables. Taking a dump of all the DBs and
2013/06/13 23:08 +, Rick James
FIND_IN_SET might work the cleanest...
WHERE FIND_IN_SET('action', genres) OR/AND [NOT] ...
And have genres look like 'action,drama,foobar', that is comma-separators, and
no need for leading/trailing comma.
That would also work for genres = '1,3,10,19,38' and
2013/06/11 12:59 -0700, Daevid Vincent
Also, just for SG this is how we are currently implementing it, but we feel
the REGEXP is killing our queries and while clever is a bit hacky and
nullifies any indexes we have on the genres column as it requires a
file_sort table scan to compare substrings
2013/06/11 12:59 -0700, Daevid Vincent
Also, just for SG this is how we are currently implementing it, but we feel
the REGEXP is killing our queries and while clever is a bit hacky and
nullifies any indexes we have on the genres column as it requires a
file_sort table scan to compare substrings
, 2013 4:17 PM
To: mysql@lists.mysql.com
Cc: 'shawn green'
Subject: RE: How do I select all rows of table that have some rows in
another table (AND, not OR)
-Original Message-
From: shawn green [mailto:shawn.l.gr...@oracle.com]
Sent: Tuesday, June 11, 2013 2:16 PM
To: mysql
Hello Daevid,
On 6/11/2013 7:17 PM, Daevid Vincent wrote:
-Original Message-
From: shawn green [mailto:shawn.l.gr...@oracle.com]
Sent: Tuesday, June 11, 2013 2:16 PM
To: mysql@lists.mysql.com
Subject: Re: How do I select all rows of table that have some rows in
another table
: 'shawn green'
Subject: RE: How do I select all rows of table that have some rows in
another table (AND, not OR)
Thinking out of the box... (And posting my reply at the 'wrong' end of the
email.)...
Are there fewer than 64 genres? Use a SET or BIGINT UNSIGNED
Oh! I must have misread. I didn't see how you had a solution for 64 bits.
I may have to experiment with that!
-Original Message-
From: Daevid Vincent [mailto:dae...@daevid.com]
Sent: Wednesday, June 12, 2013 11:26 AM
To: mysql@lists.mysql.com
Subject: RE: How do I select all rows
AM
To: mysql@lists.mysql.com
Subject: RE: How do I select all rows of table that have some rows in
another table (AND, not OR)
This idea is so fancy pants and clever I *wish* it could have worked for
me.
I checked and we actually have 65 genres currently (with more to come I'm
sure) LOL
: Daevid Vincent [mailto:dae...@daevid.com]
Sent: Wednesday, June 12, 2013 11:26 AM
To: mysql@lists.mysql.com
Subject: RE: How do I select all rows of table that have some rows in
another table (AND, not OR)
This idea is so fancy pants and clever I *wish* it could have worked for
me.
I
I am trying to implement a filter so that a user could select various genres
they want in or out. Perhaps they like 'action' and 'car chases' but
don't like 'foreign' and 'drifting' (or whatever...)
So I want something sort of like this, however IN() is using an OR
comparison when I need it to be
Hello Daevid,
On 6/11/2013 3:59 PM, Daevid Vincent wrote:
I am trying to implement a filter so that a user could select various genres
they want in or out. Perhaps they like 'action' and 'car chases' but
don't like 'foreign' and 'drifting' (or whatever...)
So I want something sort of like
-Original Message-
From: shawn green [mailto:shawn.l.gr...@oracle.com]
Sent: Tuesday, June 11, 2013 2:16 PM
To: mysql@lists.mysql.com
Subject: Re: How do I select all rows of table that have some rows in
another table (AND, not OR)
Hello Daevid,
On 6/11/2013 3:59 PM, Daevid
2012/02/29 11:43 -0500, Ed Patterson
The select concat() works from the command line
I can manually add the file name but would like to automate the process
Lastly, if it makes a difference, I don't use any graphical tools for DB stuff.
Look up the command!
By using your shell's variable substitution, I'm afraid.
export outfile='/path/to/file'
mysql -e select blah into outfile '$outfile'
You'll have to build a shell script or something that generates your filename,
and then do an interactive call.
Maybe you could write a stored procedure that
On Feb 29, 2012, at 10:43 AM, Ed Patterson wrote:
Be kind, I am by no means any type of DB expert.
I would like to eventually move this to a stored procedure but for now I am
using the \. to fire it off.
Here is what I have so far (generating a list of machines missing software)
Be kind, I am by no means any type of DB expert.
I would like to eventually move this to a stored procedure but for now I
am using the \. to fire it off.
Here is what I have so far (generating a list of machines missing software)
select last_logon.host_name_short
from last_logon
left join
Am 18.11.2011 04:31, schrieb Martin Mueller:
[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake
On a Mac with MySQL
Is it possible to make utf8 the default for all databases and transactions
in a MySQL installation?
The current default is Latin1. There is a suggestion on the Web to edit
the my.cnf file as follows
[mysqld]
init_connect=’SET collation_connection = utf8_general_ci’
init_connect=’SET NAMES utf8′
On Friday, November 18, 2011 at 03:31:44 UTC, martin.muel...@mac.com
confabulated:
Is it possible to make utf8 the default for all databases and transactions
in a MySQL installation?
The current default is Latin1. There is a suggestion on the Web to edit
the my.cnf file as follows
I just discovered that MySQL Workbench actually WILL connect columns. Use
the #6 wire type shortcut (bottom one).
However, I must be retarded or blind because I can't figure out how to make
the diagram have more than the default of 2 pages. I have a database with 50
tables and they just don't
I think this is one of those times you would update the mysql.user table
directly, then flush privileges.
JW
On Thu, Oct 14, 2010 at 6:46 PM, Daevid Vincent dae...@daevid.com wrote:
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER for
the very specific
directly, then flush privileges.
JW
On Thu, Oct 14, 2010 at 6:46 PM, Daevid Vincent dae...@daevid.com wrote:
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER
for
the very specific mysql.time_zone_name table?? I don't want to GRANT it
to
every individual user manually
Hi
On 16/10/2010, at 1:47 AM, Suresh Kuna wrote:
Hey Daevid,
As this time zone table won't change once it is set up. Do a copy
of the
table data into another database and give grants to it.
Copy the data is not a good solution. First of all, time zone data
does change. Secondly if you
-Original Message-
From: Jesper Wisborg Krogh [mailto:jes...@noggin.com.au]
Sent: Friday, October 15, 2010 2:33 PM
To: MY SQL Mailing list
Subject: Re: How do I GRANT SELECT to mysql.time_zone_name
for ANYONE?!
Hi
On 16/10/2010, at 1:47 AM, Suresh Kuna wrote:
Hey Daevid
Hi,
On 16/10/2010, at 8:50 AM, Daevid Vincent wrote:
Thanks for the reply Jesper, but either there isn't a solution in your
response, or I'm missing it?
What I mean is that you have to explicitly give the grant to each
user that should be allowed to query the table. You can't run one
-Original Message-
From: Jesper Wisborg Krogh [mailto:jes...@noggin.com.au]
Sent: Friday, October 15, 2010 5:54 PM
To: MY SQL Mailing list
Subject: Re: How do I GRANT SELECT to mysql.time_zone_name
for ANYONE?!
Any user can get into mysql, it's what they can do after that's
Part of your answer is the offset column, which seems to be relative to the
abbreviation used. This implies, to me, that each particular abbreviation
has it's own way of specifying the starting point of the time. Added is
the DST flag, which (probably) tells you that your app needs to keep
]
Sent: Wednesday, October 13, 2010 10:51 PM
To: mysql@lists.mysql.com
Subject: How do I use and JOIN the mysql.time_zone% tables?
I'm trying to figure out how to join the mysql.time_zone% tables and make
sense of this.
YES, I know how to use them with SET time_zone = timezone; and all that.
http
I'm pulling my hair out. How do I GRANT the SELECT ability to ANY USER for
the very specific mysql.time_zone_name table?? I don't want to GRANT it to
every individual user manually, I want one single GRANT that encompasses
every user simultaneously.
I've tried all of these, and they all are valid
I'm trying to figure out how to join the mysql.time_zone% tables and make
sense of this.
YES, I know how to use them with SET time_zone = timezone; and all that.
http://dev.mysql.com/doc/refman/5.0/en/time-zone-support.html
That is NOT what I need them for (yet).
I have a list of airports and
Hi there,
I install ubuntu 10.04 (64bit) on my desktop and try to move my
existing MySQL data over.
I first install MySQL on the new machine, and it can start and stop
fine. I decide to change the data folder from the default
(/var/lib/mysql) to /home/MyAccount/MySQLdata and move my existing
Does your mysql sock file reside in the same location as the error?
On Aug 29, 2010, at 12:20 PM, chen jia chen_1...@fisher.osu.edu wrote:
Hi there,
I install ubuntu 10.04 (64bit) on my desktop and try to move my
existing MySQL data over.
I first install MySQL on the new machine, and
I think so.
When I run
ls -l /var/run/mysqld/
I get
total 0
srwxrwxrwx 1 mysql mysql 0 2010-08-29 14:45 mysqld.sock
On Sun, Aug 29, 2010 at 4:02 PM, Sabika Gmail sabika.makhd...@gmail.com wrote:
Does your mysql sock file reside in the same location as the error?
On Aug 29, 2010, at 12:20
After I run sudo mysqld, I run sudo /etc/init.d/mysql start and check
the syslog by running sudo tail -f /var/log/syslog, the output is
Aug 29 21:05:42 hpdesktop kernel: [27909.007727] type=1505
audit(1283130342.751:150): operation=profile_replace pid=9994
name=/usr/bin/evince-previewer
Aug 29
Regards,
Robert.
*From:* Wagner Bianchi [mailto:wagnerbianch...@gmail.com]
*Sent:* Monday, 8 February 2010 11:11 PM
*To:* Robert Gilland
*Subject:* Re: How do I get a list of all defined UDF's known to the
system?
SELECT * FROM INFORMATON_SCHEMA.ROUTINES;
Aply filter over
How do I get a list of all defined UDF's known to the system?
Kind Regards,
Robert.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org
Hi Robert,
We can see the functions by using the below command
Show function status ;
--
Suresh Kuna
MySQL DBA
On Mon, Feb 8, 2010 at 10:37 AM, Sir Wally Lewis robert.gill...@basx.com.au
wrote:
How do I get a list of all defined UDF's known to the system?
Kind Regards,
Robert
Lewis
robert.gill...@basx.com.au
wrote:
How do I get a list of all defined UDF's known to the system?
Kind Regards,
Robert.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/mysql?unsub=sureshkumar...@gmail.com
I am trying to select all books whose authors last names begin with I, J
or K. I have 3 tables: book, author and book_author. The following query
works with one condition but not with three.
SELECT * FROM book
WHERE id IN (SELECT bookID
FROM book_author WHERE authID IN (SELECT
On Wed, Apr 1, 2009 at 1:27 PM, PJ af.gour...@videotron.ca wrote:
I am trying to select all books whose authors last names begin with I, J
or K. I have 3 tables: book, author and book_author. The following query
works with one condition but not with three.
SELECT * FROM book
WHERE id
David Giragosian wrote:
On Wed, Apr 1, 2009 at 1:27 PM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
I am trying to select all books whose authors last names begin
with I, J
or K. I have 3 tables: book, author and book_author. The following
query
I may be approaching this all wrong, but I need to know a percentage of
total sales within a select statement.
So I can do something like this:
Select company, state, sales, sum(sales) / sales as percent
From Sales
Thanks,
David Ruggles
CCNA MCSE (NT) CNA A+
Network EngineerSafe Data,
yes, u can use the below sql.
regards
anandkl
On 7/25/08, David Ruggles [EMAIL PROTECTED] wrote:
I may be approaching this all wrong, but I need to know a percentage of
total sales within a select statement.
So I can do something like this:
Select company, state, sales, sum(sales) / sales
: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2008 10:37 AM
To: David Ruggles
Cc: mysql
Subject: Re: How do I (can I) use aggregate functions inside a select
yes, u can use the below sql.
regards
anandkl
On 7/25/08, David Ruggles [EMAIL PROTECTED] wrote:
I may be approaching
David Ruggles wrote:
I may be approaching this all wrong, but I need to know a percentage of
total sales within a select statement.
So I can do something like this:
Select company, state, sales, sum(sales) / sales as percent
From Sales
mmh, you want
sum(sales where
[EMAIL PROTECTED]
-Original Message-
From: Ananda Kumar [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2008 10:37 AM
To: David Ruggles
Cc: mysql
Subject: Re: How do I (can I) use aggregate functions inside a select
yes, u can use the below sql.
regards
anandkl
-Original Message-
From: David Ruggles [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2008 10:53 AM
To: 'mysql'
Subject: RE: How do I (can I) use aggregate functions inside a select
I get:
Error Code : 1140
Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns
PROTECTED]
-Original Message-
From: Ian Simpson [mailto:[EMAIL PROTECTED]
Sent: Friday, July 25, 2008 11:15 AM
To: David Ruggles
Cc: 'mysql'
Subject: RE: How do I (can I) use aggregate functions inside a select
Hi David,
Try
Select company, state, sales, sum(sales) / sales as percent
From
Why? Because it's Friday and I'm feeling silly :)
mysql SELECT * FROM sales;
+--+---++
| company | state | sales |
+--+---++
| ABC | AZ| 140.01 |
| XYZ | AZ| 17.76 |
| ABC | NY| 123.45 |
| XYZ
Hi all,
How do I get the file names from a certain directory in SQL?
Thanks,
Siva
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hey,
How do I get the file names from a certain directory in SQL?
It seems to me that you're trying to do things that are beyong SQL
really. SQL is about the database, not about a file system.
Yes, by creating a DBMS that allows you to write functions that
interact with the file system, you
On Thu, 2008-07-24 at 17:36 +0530, Sivasakthi wrote:
Hi all,
How do I get the file names from a certain directory in SQL?
SQL is designed to deal with RDBs, not the rest of the computer system.
I suggest you switch to a modern language such as Perl, Python, Ruby, or
even PHP. Each has
Martijn Tonies wrote:
Hey,
How do I get the file names from a certain directory in SQL?
It seems to me that you're trying to do things that are beyong SQL
really. SQL is about the database, not about a file system.
Yes, by creating a DBMS that allows you to write functions
I accept that.. but my requirement is , I have some no of Excel files..I
just need to check the modified time of the files ,if it is modified
currently then I need to open those files and convert the excel data to
database.. otherwise i didnt change anything in my database..
how can i
Hello,
I feel stupid here... How do I respond to a specific post?
I posted last night, I got a response... now I want to post a response to the
response.
Don't see a way to do that...
Thanks,
Lee
**
Start the year off right. Easy ways to stay in shape.
http://body.aol.com
MCSE (NT) CNA A+
Network EngineerSafe Data, Inc.
(910) 285-7200 [EMAIL PROTECTED]
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23, 2008 10:19 AM
To: mysql@lists.mysql.com
Subject: Newbie question, how do I respond to post
How do I change:
| collation_connection| latin1_swedish_ci
|
| collation_database | latin1_swedish_ci
|
| collation_server| latin1_swedish_ci
to latin1_bin?
Is this in my.cnf? or is this another way to do this?
--
Albert E. Whale, CHS CISA CISSP
Sr
-Original Message-
From: Daevid Vincent [mailto:[EMAIL PROTECTED]
Sent: Friday, May 04, 2007 1:22 AM
To: mysql@lists.mysql.com
Subject: How do I find products when a user types freeform
strings like 'Sony 20 TV' or '20 Sony TV'?
I'm having trouble figuring out the logic/query I
On 4 May 2007 at 1:21, Daevid Vincent wrote:
I'm having trouble figuring out the logic/query I want.
I know that all those ORs are not right.
[snip]
WHERE products.enabled = 1
AND(
(products.model LIKE 'sony%' OR products.model LIKE '20%' OR
products.model LIKE 'tv%')
-Original Message-
From: Iain Alexander [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 09, 2007 3:11 PM
To: mysql@lists.mysql.com
Subject: Re: How do I find products when a user types
freeform strings like 'Sony 20 TV' or '20 Sony TV'?
On 4 May 2007 at 1:21, Daevid Vincent wrote
are not right.
I'm doing this in PHP and mySQL (of course),
so if it can't be done with a single query, I can split it up.
Here's the challenge, given a text field search box, someone enters:
Sony 20 TV
How do I search for that, not knowing which fields are which?
For example, they could
How do I search for that, not knowing which fields are which?
For example, they could have also entered:
20 Sony TV
This is the one I have now, but (as you probably noticed), it will return many
rows,
I expect that most of the time 1 row will be returned, but I'm getting a grip
more than
field search box, someone enters:
Sony 20 TV
How do I search for that, not knowing which fields are which?
For example, they could have also entered:
20 Sony TV
How about:
select soundex('Sony 20 TV' ),soundex('20 Sony TV');
'S531', 'S531'
--
Later
Mogens Melander
+45 40 85
, someone enters:
Sony 20 TV
How do I search for that, not knowing which fields are which?
For example, they could have also entered:
20 Sony TV
I think you're describing full-text indexing. MySQL supports it but only on MyISAM
tables. If you don't want to use MyISAM, full-text
can split it up.
Here's the challenge, given a text field search box, someone enters:
Sony 20 TV
How do I search for that, not knowing which fields are which?
For example, they could have also entered:
20 Sony TV
I think you're describing full-text indexing. MySQL
be done with a single query, I can split it up.
Here's the challenge, given a text field search box, someone enters:
Sony 20 TV
How do I search for that, not knowing which fields are which?
For example, they could have also entered:
20 Sony TV
I think you're describing full-text
MySQL 5.x
I have a table that looks like this:
module_id question_id email participant_answer
2 2.1 [EMAIL PROTECTED] a
2 2.2 [EMAIL PROTECTED] b
2 2.3 [EMAIL PROTECTED]
:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 6:23 PM
To: 'MySQL List'
Subject: How do I alter the result of a select
MySQL 5.x
I have a table that looks like this:
module_id question_id email participant_answer
2 2.1 [EMAIL PROTECTED
Brian, the online MySQL documentation is very complete and easy to read.
That said, you do kind of have to know what you're looking for! I'm not
sure what to recommend for a guide to beginning SQL, sorry, others may have
some thoughts.
You are going down the right road with an aggregate
I am running a small procedure for set jobs that calculates a running total
for me to display. It works fine in most cases but the math concerns me.
I am using 5.0.18 on my Windows PC and the latest 5.x on my Linux server
(both test machines).
The finance table is an InnoDb table.
CreditAmount and
For exact calculations, you need to use the DECIMAL data type. See this
section in the manual for the reasons why:
http://dev.mysql.com/doc/refman/5.1/en/precision-math-examples.html
Cheers,
Jay
Kerry Frater wrote:
I am running a small procedure for set jobs that calculates a running total
Thanks for the reference Jay.
Most helpful.
Kerry
-Original Message-
From: Jay Pipes [mailto:[EMAIL PROTECTED]
Sent: 14 December 2006 20:29
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: mysql v5 math a bit out. How do I round the info to become
correct
For exact
2006/11/16, Peter Brawley [EMAIL PROTECTED]:
Michael,
SELECT t1.id, t1.version, t1.value
FROM data t1
LEFT JOIN data t2 ON t1.id=t2.id AND t1.version t2.version
WHERE t2.id IS NULL;
I had almost the same problem and I found this solution very smart...
even smarter than I can understand
Is there a command at the command line that can tell me if I am using MyISAM
or InnoDB? Thanks :-).
--
John Kopanas
[EMAIL PROTECTED]
http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
;
CREATE TABLE ( ... ) ENGINE=InnoDB;
To show what engines are available on your MySQL server, do this:
show engines;
- Original Message -
From: John Kopanas [EMAIL PROTECTED]
To: mysql@lists.mysql.com
Sent: Friday, November 17, 2006 12:13:33 PM GMT-0500 US/Eastern
Subject: How Do I Know
show variables like 'storage_engine';
I forgot the underscore in the lastmessage
- Original Message -
From: Rolando Edwards [EMAIL PROTECTED]
To: John Kopanas [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, November 17, 2006 12:30:51 PM GMT-0500 US/Eastern
Subject: Re: How Do I
For any specific table if you do:
show create table tablename;
It will tell you what the able was created using. To create tables using
a specific engine add ENGINE=name to the end of your create statement.
To see the default that is used (I think this is what the table_type
variable does):
This is in 4.0, it has changed in more recent versions.
Mike Kruckenberg wrote:
For any specific table if you do:
show create table tablename;
It will tell you what the able was created using. To create tables
using a specific engine add ENGINE=name to the end of your create
statement.
To
PROTECTED]
To: John Kopanas [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Friday, November 17, 2006 12:32:19 PM GMT-0500 US/Eastern
Subject: Re: How Do I Know If mySQL is using MyISAM or InnoDB?
For any specific table if you do:
show create table tablename;
It will tell you what the able
Do I Know If mySQL is using MyISAM or InnoDB?
Is there a command at the command line that can tell me if I am using
MyISAM
or InnoDB? Thanks :-).
--
John Kopanas
[EMAIL PROTECTED]
http://www.kopanas.com
http://www.cusec.net
http://www.soen.info
--
MySQL General Mailing List
For list
Michael,
SELECT t1.id, t1.version, t1.value
FROM data t1
LEFT JOIN data t2 ON t1.id=t2.id AND t1.version t2.version
WHERE t2.id IS NULL;
I had almost the same problem and I found this solution very smart...
even smarter than I can understand :)
Can someone explain to me why/how this query works
Hi all,
I have the following simple table:
CREATE TABLE data (
id int NOT NULL,
version int NOT NULL,
value int NOT NULL,
PRIMARY KEY (id, version)
)
ENGINE=InnoDB DEFAULT CHARSET=utf8;
What I would like to do is to find all the values for the latest
versions, that is, for every id I
for every id I want exactly one row, namely the row with the maximum
value of version.
SELECT id,MAX(version) FROM data GROUP BY id;
PB
-
Sebastiaan van Erk wrote:
Hi all,
I have the following simple table:
CREATE TABLE data (
id int NOT NULL,
version int NOT NULL,
value int NOT
-
From: Peter Brawley [EMAIL PROTECTED]
To: Sebastiaan van Erk [EMAIL PROTECTED], mysql@lists.mysql.com
Sent: Monday, November 13, 2006 9:18:49 AM GMT-0500 US/Eastern
Subject: Re: How do I do this query efficiently?
for every id I want exactly one row, namely the row with the maximum
value
Hi,
Thanks for your quick answer, but unfortunately this query does not
return the value column of the row; and that is the column I am
ultimately interested in (in combination with the id).
Regards,
Sebastiaan
Peter Brawley wrote:
for every id I want exactly one row, namely the row with
Try this !!!
- Original Message -
From: Rolando Edwards [EMAIL PROTECTED]
To: peter brawley [EMAIL PROTECTED]
Cc: Sebastiaan van Erk [EMAIL PROTECTED], mysql@lists.mysql.com
Sent: Monday, November 13, 2006 9:28:46 AM GMT-0500 US/Eastern
Subject: Re: How do I do this query efficiently
;
- Original Message -
From: Peter Brawley [EMAIL PROTECTED]
To: Sebastiaan van Erk [EMAIL PROTECTED], mysql@lists.mysql.com
Sent: Monday, November 13, 2006 9:18:49 AM GMT-0500 US/Eastern
Subject: Re: How do I do this query efficiently?
for every id I want exactly one row, namely the row
Right, if you want the value column you need too, you need a different
query ...
SELECT t1.id, t1.version, t1.value
FROM data t1
LEFT JOIN data t2 ON t1.id=t2.id AND t1.version t2.version
WHERE t2.id IS NULL;
PB
Sebastiaan van Erk wrote:
Hi,
Thanks for your quick answer, but unfortunately
Pretty slick.
- Original Message -
From: Peter Brawley [EMAIL PROTECTED]
To: Sebastiaan van Erk [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Sent: Monday, November 13, 2006 10:43:26 AM GMT-0500 US/Eastern
Subject: Re: How do I do this query efficiently?
Right, if you want the value column
Wow, neat. I didn't think you could do that without a subquery somewhere.
Learned a cool new trick today. Thanks!
Regards,
Sebastiaan
Peter Brawley wrote:
Right, if you want the value column you need too, you need a different
query ...
SELECT t1.id, t1.version, t1.value
FROM data t1
LEFT
Dear all,
If I am already have a datadir in /var/lib/mysql and I intend to start
a new one in /var/lib/mysql2, how do i do it ?
Thanks in advance,
Low Kian Seong
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL
@lists.mysql.com
Sent: Friday, October 13, 2006 10:11 AM
Subject: How do i initialize a new datadir in mysql ?
Dear all,
If I am already have a datadir in /var/lib/mysql and I intend to start
a new one in /var/lib/mysql2, how do i do it ?
Thanks in advance,
Low Kian Seong
--
MySQL General Mailing List
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
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
1 - 100 of 426 matches
Mail list logo