this verbose logic: SELECT
DISTINCT X FROM A WHERE Y equals 25 and Y also does NOT equal 24.
I came up with the following SQL, which gives me my desired result,
but is there a better way to do it? Can it be achieved using MINUS or
UNION somehow?
BTW, I'm using IN here because I intend to replace
-Original Message-
From: Chris W [mailto:4rfv...@cox.net]
Sent: Sunday, December 27, 2009 6:02 PM
To: Tim Molter
Cc: mysql@lists.mysql.com
Subject: Re: Is there a better way than this?
Unless I am missing something, this should work.
SELECT DISTINCT X FROM `A`
WHERE Y IN (25)
AND Y
Cc: mysql@lists.mysql.com
Subject: Re: Is there a better way than this?
Unless I am missing something, this should work.
SELECT DISTINCT X FROM `A`
WHERE Y IN (25)
AND Y NOT IN (24)
Chris W
Tim Molter wrote:
I'm new to MySQL and I'm looking for some guidance. I have a table A,
with two
logic: SELECT
DISTINCT X FROM A WHERE Y equals 25 and Y also does NOT equal 24.
I came up with the following SQL, which gives me my desired result,
but is there a better way to do it? Can it be achieved using MINUS or
UNION somehow?
BTW, I'm using IN here because I intend to replace the single
: SELECT
DISTINCT X FROM A WHERE Y equals 25 and Y also does NOT equal 24.
I came up with the following SQL, which gives me my desired result,
but is there a better way to do it? Can it be achieved using MINUS or
UNION somehow?
BTW, I'm using IN here because I intend to replace the single numbers
(24
On 12/27/2009 06:04 PM, Tim Molter wrote:
I'm new to MySQL and I'm looking for some guidance. I have a table A,
with two columns X and Y with the following data:
| X|Y|
1 24
1 25
2 25
2 26
3 27
I want my SQL query
,
but is there a better way to do it? Can it be achieved using MINUS or
UNION somehow?
BTW, I'm using IN here because I intend to replace the single numbers
(24 and 25) with arrays that have 0 to N members.
SELECT DISTINCT X FROM `A`
WHERE X IN (
SELECT X FROM `A` WHERE Y IN (25)
)
AND X NOT IN (
SELECT X FROM
-Ursprüngliche Nachricht-
Von: Per Jessen [mailto:p...@computer.org]
Gesendet: Freitag, 4. September 2009 13:05
An: mysql@lists.mysql.com
Betreff: Re: a better way, code technique?
AndrewJames wrote:
is there a better way (hopefully simpler) to code this?
i want to get the user id
hahah thank-you, love the responses here. you guys are awesome..
ps, where does the %s come from?
--
From: majk.sko...@eventim.de
Sent: Friday, September 04, 2009 9:11 PM
To: p...@computer.org; mysql@lists.mysql.com
Subject: AW: Re: a better way
-Ursprüngliche Nachricht-
Von: AndrewJames [mailto:andrewhu...@gmail.com]
Gesendet: Freitag, 4. September 2009 13:35
An: Skoric, Majk; p...@computer.org; mysql@lists.mysql.com
Betreff: Re: AW: Re: a better way, code technique?
hahah thank-you, love the responses here. you guys
Hello,
I`m doing a database in MySQL to catalog cds, and i`m not sure if my table
structure is the best way to do it:
Artist Table
Artist_Id int unsigned not null auto_increment primary key
Name char(120) // Artist or Band Name
Country char(30) // Artist Or Band Country
Members char(255) //
At 20:43 -0600 2/26/03, Paul DuBois wrote:
At 21:32 -0500 2/26/03, Jianping Zhu wrote:
I have a guest book which have three fields.
user name
email
comments
I want to mysql to store the information, but commnet maybe very long, is
there a better way to handle it instead of set a varchar(2000
I have a guest book which have three fields.
user name
email
comments
I want to mysql to store the information, but commnet maybe very long, is
there a better way to handle it instead of set a varchar(2000) or more for
a field comment in the table?
Thanks
At 21:32 -0500 2/26/03, Jianping Zhu wrote:
I have a guest book which have three fields.
user name
email
comments
I want to mysql to store the information, but commnet maybe very long, is
there a better way to handle it instead of set a varchar(2000) or more for
a field comment in the table
maybe very long, is
there a better way to handle it instead of set a varchar(2000) or more for
a field comment in the table?
VARCHAR has a maximum length of 2000. In MySQL 4.1, it will be converted
automatically to TEXT. But you can use TEXT in any version of MySQL.
Is that suitable for what
, MEDIUMTEXT, and LONGTEXT.
J.P.
On Wed, 26 Feb 2003, Paul DuBois wrote:
At 21:32 -0500 2/26/03, Jianping Zhu wrote:
I have a guest book which have three fields.
user name
email
comments
I want to mysql to store the information, but commnet maybe very long, is
there a better way to handle
Below is a little PHP code snippet which works great(returns results quickly)
for single
queries. However when I put this code into a loop incrementing the order_index
and line,
my application can take as long as 2 minutes to return results. Is there any
other way
to execute this series of queries
17 matches
Mail list logo