Richard,
No problem, glad it works. But note: this is not scalable. If you have
more than a few hundred rows, you may want to think about a better
solution, like storing the order field permanetly and giving it an index :)
Ben
Richard wrote:
Thanks, it works like a charm :)
Ben Clewett
Thanks,
This is for the unanswered list of questions, so the output list (not
the list stored in the mysql database) should never go over 100.
by scalable, do you mean alot of ressources being used or a long wait
for the answer? Because I belive I Could just use a simple limit if I
needed
On Tue, 8 Apr 2008, Richard [EMAIL PROTECTED] wrote:
Kristian Myllym?ki a ?crit :
mysql version?
http://dev.mysql.com/doc/refman/5.0/en/case-statement.html
order by case when updated is not null then updated else created
end desc;
Hello I've tried the following with mysql 4.1.11
SELECT *
Not sure, but perhaps an even simpler method would be to consider the
initial insert an update as well... so the update column would always have
a value. Then the sort would (I believe) always be in the order you want,
and if you need to differentiate between rows that are new vs rows that
are
of
the variable 'tmp_table_size'. Then the result will be pruned to the
LIMIT and sent.
You can see that the LIMIT does not help, MySql needs to know what the
top rows will be, before it discards the bottom ones. It can't know
this until all data has been gathered and sorted.
This is all quite
Yes that would be easier, except that I would still have to create a
tempory table to add 10 days onto the ones which have a status waiting
for answer from customer and have not been answered for more than 10 days.
This system is for customers who do not have an account yet to contact
me. And
orderbytime
orderbytime 8 netlivin3.UC.id_conversation1
1 SIMPLE C ALL id_conversation NULL
NULL NULL3 Using
where
im completely lost here, ill really appreciate any help.
thanks.
To: Natalie Warshager
Cc: mysql@lists.mysql.com
Subject: Re: Can some one help me write it shorter?
Hi,
On Thu, Apr 3, 2008 at 3:25 AM, nataliew
[EMAIL PROTECTED] wrote:
I need querylike this that make a row of numbers (in one execute)
SELECT a from (
SELECT -1 a UNION ALL
Baron Schwartz wrote:
Hi,
This is a fine place to ask such questions.
(In general you can just ask first, and people will tell you if you're
off-topic).
OK, thanks - I've posted the details to a new subject earlier today but
it doesn't seem to have showed up yet.
--
Richard Jones
--
I have a complex application under re-development, and am stuck on the
data model which is almost certainly wrong. The application is designed
to handle clinical requests coming into a hospital records system. A
request concerns a single patient, and can come from a hospital or a GP
(general
help with MySQL database design, or is there an alternative
forum. It is of course not a MySQL-specific question, and would be
applicable to any relational db. Thanks.
This is a fine place to ask such questions.
(In general you can just ask first, and people will tell you if you're
off-topic
Hi,
On Thu, Apr 3, 2008 at 3:25 AM, nataliew
[EMAIL PROTECTED] wrote:
I need querylike this that make a row of numbers (in one execute)
SELECT a from (
SELECT -1 a UNION ALL
SELECT -2 UNION ALL
SELECT -3 UNION ALL
SELECT -4 UNION ALL
SELECT -5 UNION ALL
SELECT -6 UNION ALL
You can use temporary table if you want short statement.
On Mon, Apr 7, 2008 at 9:24 AM, Baron Schwartz [EMAIL PROTECTED] wrote:
Hi,
On Thu, Apr 3, 2008 at 3:25 AM, nataliew
[EMAIL PROTECTED] wrote:
I need querylike this that make a row of numbers (in one execute)
SELECT a from (
:
http://www.nabble.com/Can-some-one-help-me-write-it-shorter--tp16467090p16467090.html
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
is returned, suggesting my data model is not quite correct.
I haven't included either db schema or queries here due to the likely
length of the posting, but would initially like to ask if this is the
right forum to request help with MySQL database design, or is there an
alternative forum
tech user wrote:
Add an alias for the subquery
select * from ( select ) my_alias where dd = 3;
Better, use a having clause and eliminate the subquery. Odds are it
will be more efficient in MySQL.
How to replace the original one with a having statement?
Thanks again.
hello,
I try to execute this sql in mysql shell,but got error as:
mysql select * from (select uin,count(*) as dd from active_users where
date = date_add(curdate(),interval -30 day) group by uin) where dd =3;
ERROR 1248 (42000): Every derived table must have its own alias
But I can execute
tech user wrote:
hello,
I try to execute this sql in mysql shell,but got error as:
mysql select * from (select uin,count(*) as dd from active_users where
date = date_add(curdate(),interval -30 day) group by uin) where dd =3;
ERROR 1248 (42000): Every derived table must have its own alias
Add an alias for the subquery
select * from ( select ) my_alias where dd = 3;
Better, use a having clause and eliminate the subquery. Odds are it
will be more efficient in MySQL.
How to replace the original one with a having statement?
Thanks again.
Get the name you
isDefined(arguments.testOnly) and arguments.testOnly IS 1
and users.testOnly = cfqueryparam value=#arguments.testOnly#
cfsqltype=CF_SQL_SMALLINT
/cfif
please help with the [select] and [from] (inner join?). Thank you very much
Hi Trevor,
I'm CCing the MySQL list, where you may get faster response. Also try
the #mysql IRC channel on Freenode if you need help faster.
Cheers
Baron
On Sun, Mar 23, 2008 at 2:38 PM, Trevor Smith [EMAIL PROTECTED] wrote:
I realize that this is a huge favour to ask for free tech support
I am an idiot. table_a and table_b have exactly the same structure.
How do I say this in SQL:
INSERT (all records from table_a) into table_b where table_a.customer
= '12'
Just trying to eventually duplicate the whole table, one customer's
set of records at a time. Thanks.
--
MySQL
Thanks to everyone who replied. So simple I couldn't see it. :-)
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
On Wednesday 12 March 2008 00:14:46 Brian Dunning wrote:
I am an idiot. table_a and table_b have exactly the same structure.
How do I say this in SQL:
INSERT (all records from table_a) into table_b where table_a.customer
= '12'
Just trying to eventually duplicate the whole table, one
Hi, im having a lot of trouble with one query, i hope someone could give me
a hand with this, i would be really grateful
these are the tables:
TABLE friends
id_usr INT
id_friend INT
with INDEX on (id_usr,id_friend)
TABLE status
id_usr INT
lastConnection
(other irrelevant info)
with INDEX
This may take a bit of explaining!
I have a incoming table structure of
PartRef AttribValue
ABC0011 10.00
ABC0012 4
ABC0013 A
ABC0021 12.00
ABC0022 6
ABC002
Yes, I did and what happens is that the 'xxx' becomes appended to the
next line and the line after that asks the user for the password
(which also fails).
The way I got it working was this:
mysql -u root -p
Kindest regards,
Unnsse
On Feb 25, 2008, at 8:34 AM, fire9 wrote:
Unnsse Khan
, any
recommendations are much appericated!
PS: I posted this question on Java section but no replys :(
Ray
--
View this message in context:
http://www.nabble.com/jdbc-connection-pool-problem%2C-help%2C-thanks%21-tp15673813p15673813.html
Sent from the MySQL - General mailing list archive
Hello there,
I am running OS X Leopard on an Intel based iMac machine...
Followed the instructions to a T and everything works as described in:
http://hivelogic.com/articles/installing-mysql-on-mac-os-x/
Now, after running MySQL using launchd, when I try to login using:
mysql -u root
I get
Hello there,
I am running OS X Leopard on an Intel based iMac machine...
Followed the instructions to a T and everything works as described in:
http://hivelogic.com/articles/installing-mysql-on-mac-os-x/
Now, after running MySQL using launchd, when I try to login using:
mysql -u root
I get
tables, you should not define several ON UPDATE CASCADE clauses that act
on the same column in the parent table or in the child table.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 20 February 2008 12:44
To: mysql@lists.mysql.com
Subject: sql help: delete row
Say I have two tables:
table_a
--
a_id (primary key)
b_id
table_b
--
b_id (primary key)
name
there is a one to many mapping between rows in table b and rows in
table a.
Say I had an Id of a row in table a an (a_id, say 5). Now, what I
want to do is delete the row in table_a
Just use the type varchar.I always use it in my regular life.
On Feb 11, 2008 4:44 PM, Magne Westlie [EMAIL PROTECTED] wrote:
Jerry Schwartz wrote:
SELECT user_id, user_name FROM user_test WHERE user_id IN (SELECT
uid
FROM temp_uids);
[JS] Couldn't you replace the WHERE user_id IN
Jerry Schwartz wrote:
SELECT user_id, user_name FROM user_test WHERE user_id IN (SELECT
uid
FROM temp_uids);
[JS] Couldn't you replace the WHERE user_id IN (SELECT uid FROM
temp_uids)
with a simple JOIN? If IN is badly optimized, as I've read here, wouldn't
that be more efficient? Or am I
Hello
I am running a Freebsd server:
1. Software:
Apache 1.3
mysql 5.0.27
php 4.4
2. Hardware:
2 intel procerssors
4 gb ram
RAID 10 with hard drives 15K rpm
I am having this problem quite often now. Apache stops responding due to
mysql (my guess). And I cannot connect to mysql server:
, as when it comes to
speed of execution in this solution.
Thanks for your help Peter.
My solution (with an argument that may look weird, but I found out
adding the extra paranthesis while generating the string in Python was
so much easier that doing it in the sproc) (working test
-Original Message-
From: Magne Westlie [mailto:[EMAIL PROTECTED]
Sent: Friday, February 08, 2008 5:37 AM
To: [EMAIL PROTECTED]
Cc: mysql@lists.mysql.com
Subject: Re: stored procedure, parameter type help needed
Hi again,
I found a way that works for the query I wanted in my sproc
Dear List,
I want to create a stored procedure that runs a query using the IN
operator (or is IN a function???) on values sent as argument. That is,
my procedure should be called with something like:
CALL get_users((1,2));
and I was hoping to implement something like this:
CREATE PROCEDURE
Hi,
Thanks a lot Peter, that was useful and it worked fine. The only problem
is that the query I actually want to use this in, is a 100 line query
with lots of arguments. I don't feel to good about creating it into a
bunch of strings (16) that I have to concatenate with the variables
Magne,
I want to create a stored procedure that runs a query using the IN
operator ...
See 'Variable-length argument for query IN() clause' at
http://www.artfulsoftware.com/queries.php
PB
-
Magne Westlie wrote:
Dear List,
I want to create a stored procedure that runs a query using
Hi Magne
...the query I actually want to use this in, is a 100 line query with
lots of arguments.
I don't feel to good about creating it into a bunch of strings (16)
that I have to
concatenate with the variables inbetween.
The only alternative I know for current versions of MySQL is to
Magne,
Sorry, the server is down at the moment, here is the entry ...
To have an sproc accept a variable-length parameter list for an
|IN(...)| clause in a query, code the sproc to |PREPARE| the query
statement:
|
DROP PROCEDURE IF EXISTS passInParam;
DELIMITER |
CREATE PROCEDURE
Rakesh!
The distance_sphere and makebox2d functions are specific to postgis.
MySQL GIS Implementation is based on the Open GIS Simple SQL
Specification (read more on www.opengeospatial.com). The SetSRID is also
not in the specification as far as I know (it should be, but I can't
find it),
Hi All
I looking for the stated functions. Earlier I was using postGIS in that
they are present i am wondering if I can get similar kind of method in
MySql.I am Using Mysql 5.0.51a version.
1. I am trying to retrieve the distance between two geometries in the
table using the following
Hi,
I need some urgent for sql query.. It will be great if someone could help
me..
I have ARTICLE, FAVORITE_ARTICLES, RATING Tables apart from other table
USER, CHANNEL, CATEGORY etc
ARTICLE table stores a user's article, FAVORITE_ARTICLES will store a user's
favorite articles, and rating
Hello All.
I'm new to mysql. I would like to issue a query from the command line
and pass the result to an update done on the command line within the
same script. See below.
My question is how can I run a select from the command line and pass the
values to an update
SELECT SYS_ID, SYS_LOCATION,
[snip]
I'm new to mysql. I would like to issue a query from the command line
and pass the result to an update done on the command line within the
same script. See below.
My question is how can I run a select from the command line and pass the
values to an update
SELECT SYS_ID, SYS_LOCATION,
[snip]
SELECT SYS_ID, SYS_LOCATION, SYS_IP FROM PROD_SERVER;
UPDATE TEST_SERVER
SET SYS_ID = value passed from above
SYS_LOCATION = value passed from above
SYS_IPADDRESS = value passed from above;
[/snip]
And here http://dev.mysql.com/doc/refman/5.1/en/user-variables.html
--
[snip]
Hello Jay. Thanks for your reply but where is your solution to my
problem. I'm lost here. Help me -- please
Thx
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23, 2008 11:29 AM
To: Brown, Charles; mysql@lists.mysql.com
Subject: RE
On Jan 23, 2008 2:36 PM, Jay Blanchard [EMAIL PROTECTED] wrote:
[snip]
Hello Jay. Thanks for your reply but where is your solution to my
problem. I'm lost here. Help me -- please
Thx
-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23
thanks
-Original Message-
From: obed [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 23, 2008 10:49 PM
To: Jay Blanchard
Cc: Brown, Charles; mysql@lists.mysql.com
Subject: Re: executing query from the command line -- need help
On Jan 23, 2008 2:36 PM, Jay Blanchard [EMAIL PROTECTED
Hi,
On Jan 18, 2008 2:59 PM, RoryGRen [EMAIL PROTECTED] wrote:
Hi all
I am quite new to mySQL and have the following question I hope someone can
help me with:
I have a database table imported directly from MS Access with two of the
field names having brackets - F(1) and S(1). I don't want
Hi all
I am quite new to mySQL and have the following question I hope someone can
help me with:
I have a database table imported directly from MS Access with two of the
field names having brackets - F(1) and S(1). I don't want to change the
field names, as I am simply going to import again when
Hi all,
I'm looking for information about References attribute in Mysql, help me!
thanks in advance.
Bo
:
http://www.nabble.com/Help-with-HOST-LOGIN-PASS-NAME-tp14845571p14845571.html
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Hi,
You don't need to change the hostname to reflect the new server if you run php
from the same server. Could you post the error you get when you insert new
records.
Saravanan
--- On Wed, 1/16/08, meridklt [EMAIL PROTECTED] wrote:
From: meridklt [EMAIL PROTECTED]
Subject: Help with HOST
Hi:
I have a table that I need help to summarize the data. I need to be able to
create one row of data for custno + prodno + period + weekno combination
summarized by Invtot.
Any help will be greatly appreciated.
Best regards
I am attaching the relevant info below:
Sales
You can just use function sum to get what you want.
On Jan 16, 2008 6:23 AM, Imran [EMAIL PROTECTED] wrote:
Hi:
I have a table that I need help to summarize the data. I need to be able
to
create one row of data for custno + prodno + period + weekno combination
summarized by Invtot
--- On Wed, 1/16/08, meridklt [EMAIL PROTECTED] wrote:
From: meridklt [EMAIL PROTECTED]
Subject: Help with HOST LOGIN PASS NAME
To: mysql@lists.mysql.com
Date: Wednesday, January 16, 2008, 2:35 AM
Firstly I know nothing about MySQL but had to move hosts and
followed the
export from
Dear Users
I searched google, find alot of tips, but none of the them was
successfully.
After a db move with ibdata files, which cannot be dumped (cause of a table
failure) we made a hardcopy of the files and moved it onto the new server.
Eg. we copy ibdatafiles, the original my.cnf to the new
I have this query:
SELECT table.id,table.field_1,table.field_2,COUNT(table.field_1) as total
FROM table
WHERE MATCH table.field_1 AGAINST ('some text')
GROUP BY table.field_1,table.field_2
which returns aggregate results like:
1, data..., data..., 3
2, data..., data..., 1
3, data..., data...,
On Jan 10, 2008 5:40 PM, Eben [EMAIL PROTECTED] wrote:
I want to be able to do count of the total records brought back by this
query... but since I am using the group by I can't use COUNT() in the
desired way.
Assuming what you want is all the data from your current query plus an
additional
Perrin Harkins schrieb:
On Jan 4, 2008 5:51 PM, Eben [EMAIL PROTECTED] wrote:
The resultset is paginated on the front end using the
SQL_CALC_FOUND_ROWS functionality...
Usually a bad idea:
http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/
On Jan 9, 2008 4:33 AM, Sebastian Mendel [EMAIL PROTECTED] wrote:
usually ... but i do not know of any index capable of having FULLTEXT and
'normal' fields in one index
Does that matter? It would have to be doing a full scan for
SQL_CALC_FOUND_ROWS to work out well.
- Perrin
--
MySQL
Perrin Harkins schrieb:
On Jan 9, 2008 4:33 AM, Sebastian Mendel [EMAIL PROTECTED] wrote:
usually ... but i do not know of any index capable of having FULLTEXT and
'normal' fields in one index
Does that matter?
yes, as written in the mentioned article the test is only relevant with
correct
Hi List,
I am wondering if someone can help me with a query to check what databases
are on the MySQL server and then check which of those databases are either
partially or completely within the date range i require.
The scenario is as follows:
db1 : 2007-01-01 to 2007-02-01
db2 : 2007-02-01
On Jan 9, 2008 8:34 AM, Sebastian Mendel [EMAIL PROTECTED] wrote:
yes, as written in the mentioned article the test is only relevant with
correct used indexes, but MySQL does not use more than one index, so this
query cannot all be done with indexes
Well, first of all, MySQL 5 does use more
Your biggest problem is probably the subquery/IN your are performing.
You should change that to a join. And I don't know about using
SQL_CALC_FOUND_ROWS in a full text query that's not boolean, and you
shouldn't use it unless you have a LIMIT clause.
SELECT SQL_CALC_FOUND_ROWS
am wondering if someone can help me with a query to check what
databases
are on the MySQL server and then check which of those databases are
either
partially or completely within the date range i require.
The scenario is as follows:
db1 : 2007-01-01 to 2007-02-01
db2 : 2007-02-01 to 2007-03
Hi All
I have the following data example
UID Timestamp
123456 20071201 12:00:01
123456 20071201 12:00:06
987654 20071201 12:00:01
987654 20071201 12:00:09
etc
I need :
UID Timestamp secs
123456 20071201 12:00:01
Mark, is the 'secs' column the offset from the minimum value of the
timestamp column?
If so, you might try something like this:
SELECT UNIX_TIMESTAMP(MIN(timestamp)) INTO @min_timestamp FROM my_table;
SELECT uid, timestamp,
UNIX_TIMESTAMP(timestamp) - @min_timestamp AS secs
FROM my_table
ORDER
I left something out, the query looks like:
SELECT SQL_CALC_FOUND_ROWS table_1.id,table_2.*
FROM table_2
LEFT JOIN table_1 ON table_2.shared_id = table_1.shared_id
WHERE MATCH table_2.field AGAINST ('value')
AND table_2.current = 1
AND table_2.shared_id IN (SELECT shared_id FROM table_1_view)
On Jan 4, 2008 5:51 PM, Eben [EMAIL PROTECTED] wrote:
The resultset is paginated on the front end using the
SQL_CALC_FOUND_ROWS functionality...
Usually a bad idea:
http://www.mysqlperformanceblog.com/2007/08/28/to-sql_calc_found_rows-or-not-to-sql_calc_found_rows/
- Perrin
--
MySQL General
Hi,
I have a query that has to run on a full text indexed table with many
millions of records. I'm trying to figure out some optimizations for
it. Here's the general query:
SELECT SQL_CALC_FOUND_ROWS table_1.id,table_2.*
FROM table_2
LEFT JOIN table_1 ON table_2.shared_id =
I've never used this feature before on my application.
On Jan 5, 2008 7:06 AM, Perrin Harkins [EMAIL PROTECTED] wrote:
On Jan 4, 2008 5:51 PM, Eben [EMAIL PROTECTED] wrote:
The resultset is paginated on the front end using the
SQL_CALC_FOUND_ROWS functionality...
Usually a bad idea:
Richard a écrit :
Sorry about my last email which was long and not clear.
This is what I want to do
Join two tables on code table1 = code table3 where messageid = for
example 28
table 1 contains :
message from messageid
--
not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within this
transmission. Date: Sun, 30 Dec 2007 13:54:32 +0100 From: [EMAIL PROTECTED]
To: mysql@lists.mysql.com Subject: Re: Help with query, (question simplified
as last
Hello, I'm trying to get what is for me quite a complicated query to
work, if it's possible to do so anyway ...
Here is my old query :
SELECT a.message,a.date,b.surname,b.name,b.title FROM messages a JOIN
info b ON a.from=b.code WHERE a.id='28'
It worked fine untill I needed to have more than
Sorry about my last email which was long and not clear.
This is what I want to do
Join two tables on code table1 = code table3 where messageid = for
example 28
table 1 contains :
message from messageid
--
message1 |
Anders Norrbring skrev:
Brent,
you put me on the right track.. ;) Reading up a bit on syntax for
variables, I came up with the following, which seems to work.
SET @tid:=(SELECT tid FROM objects WHERE shortname = %s);
SET @vid:=(SELECT vid FROM itemtypes WHERE itemtype LIKE %s);
SELECT
Hi.. I'm struggling with a query that I'm trying to simplify as much as
possible, but I can't seem to get rid of using the very same subqueries
several times.
Would there be a way to optimize the following so I get rid of
subqueries that do the exact same thing more than once?
SELECT
Moon's Father skrev:
Just a look at your sql query at first.
Your like key word's right must like this:
like 's%', then it'll use the index you created for your table.
The second try you may use temporary table to replace your own query like
(SELECT uid FROM users WHERE username = %s)
Well,
Brent Baisley skrev:
You might be able to use variables to store the result of the query.
Although I've never tried assigning the result of a query to a
variable, only field values.
SELECT (count(*)+)/(SELECT COUNT(*) FROM score AS s2
WHERE s2.tid = @tid:=(SELECT tid FROM objects WHERE
Brent,
you put me on the right track.. ;) Reading up a bit on syntax for
variables, I came up with the following, which seems to work.
SET @tid:=(SELECT tid FROM objects WHERE shortname = %s);
SET @vid:=(SELECT vid FROM itemtypes WHERE itemtype LIKE %s);
SELECT (count(*)+)/(SELECT COUNT(*)
Brent Baisley skrev:
You're right that wouldn't work because you can't assign the query
results to a variable. You want to put the variables in the query and
assign them to the value of the field.
...WHERE s2.tid = (SELECT @tid:=tid AS tid FROM objects WHERE shortname = %s)...
That should work
You could use a view:
CREATE VIEW all_scores
SELECT s.tid, s.vid, s.uid, s.highScore
FROM score s
JOIN objects o
ON s.tid = o.tid
JOIN itemtypes it
ON s.vid = it.vid
JOIN users u
ON s.uid = u.uid
WHERE o.shortname = %s /* Should these ANDs really be ORs? */
AND i.itemtype LIKE %s;
SELECT
On Wed, Dec 12, 2007 at 05:11:43PM -0800, Ed Reed wrote:
I've found a glaring problem with the latest ODBC connector. Data
types have been changed and data is no longer being read correctly.
That's not quite correct -- data types are now actually being read
correctly. They were wrong before,
that it always returns a VarChar
Thanks for the help
I'm looking at a situation I haven't run into before, and I'm a bit
puzzled by it.
I have this table structure:
Table USERS: userid, class
Table OBJECT: userid, class, result
Now I want to query the database for a certain user's result in a
specified class, which is very, very easy. No
On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote:
I'm looking at a situation I haven't run into before, and I'm a bit
puzzled by it.
I have this table structure:
Table USERS: userid, class
Table OBJECT: userid, class, result
Now I want to query the database for a certain
On Dec 11, 2007, at 10:46 AM, Rob Wultsch wrote:
On Dec 11, 2007 8:38 AM, Anders Norrbring [EMAIL PROTECTED] wrote:
I'm looking at a situation I haven't run into before, and I'm a bit
puzzled by it.
I have this table structure:
Table USERS: userid, class
Table OBJECT: userid, class, result
Anders,
I also want to find out the user's position relative to others
depending on the result.
For a given pUserID, something like this?
SELECT userid,result,rank
FROM (
SELECT o1.userid,o1.result,COUNT(o2.result) AS rank
FROM object o1
JOIN object o2 ON o1.result o2.result OR
Greetings.
I have 1 procedure that summarises data in a table for one particular
location. It accepts the location ID, and returns the summary as a
single record. It works well.
Now I'm trying to write a procedure that selects all location IDs, and
calls this 1st procedure for every single
, but
specifying field4 as abcd in all of them.
How can I do this?
Cheers!
--
View this message in context:
http://www.nabble.com/HELP%3A-How-to-duplicate-rows...-tf4962682.html#a14214522
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For list archives
At 09:39 AM 12/7/2007, rfeio wrote:
INSERT INTO table1 (field2, field3, field4) SELECT field2, field3, field4
WHERE field2=x
Have you tried:
INSERT INTO table1 (field2, field3, field4) SELECT field2, field3, ABCD
WHERE field2=x
Mike
--
MySQL General Mailing List
For list archives:
://www.nabble.com/HELP%3A-How-to-duplicate-rows...-tf4962682.html#a14214522
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
before, but
specifying field4 as abcd in all of them.
How can I do this?
Cheers!
--
View this message in context:
http://www.nabble.com/HELP%3A-How-to-duplicate-rows...-tf4962682.html#a14214522
Sent from the MySQL - General mailing list archive at Nabble.com.
--
MySQL General Mailing List
hi list,
i have two tables:
idea(iid int not null primary_key auto_increment,
completed_by int,
submitted_by int);
employee(eid int not null primary_key auto_increment,
first varchar(20),
last varchar(30));
table idea data:
1 | 4 | 10
2 | 3 | 7
table employee data:
3 | john | Doe
4
You might try this:
SELECT I.iid, CONCAT(ECOMP.last, ', ', ECOMP.first) AS 'Completed By',
CONCAT(ESUB.last, ', ', ESUB.first) AS 'Submitted By',
FROM idea I JOIN employee ECOMP ON I.completed_by = ECOMP.eid
JOIN employee ESUB ON I.submitted_by = ESUB.eid
andy
Hiep Nguyen
PROTECTED]
To: mysql@lists.mysql.com
Sent: Wednesday, December 05, 2007 2:02 PM
Subject: help with select
hi list,
i have two tables:
idea(iid int not null primary_key auto_increment,
completed_by int,
submitted_by int);
employee(eid int not null primary_key auto_increment,
first varchar(20
801 - 900 of 7035 matches
Mail list logo