Query. Urgent!

2006-10-09 Thread Renish

Hi all,


I have installed MySql 4.1 in my system. when I tried to run Mysql , I 
always gets this error.


Could not start MySql service on a local computer
Error 1067: the process terminated unexpectedly.

Any help is highly appreciated.

Regards,
Renish




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Query...Urgent

2006-10-09 Thread Renish

Hi all,


I have installed MySql 4.1 in my system. when I tried to run Mysql , I 
always gets this error.


Could not start MySql service on a local computer
Error 1067: the process terminated unexpectedly.

Any help is highly appreciated.

Regards,
Renish




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



A difficult query- urgent for me

2006-01-15 Thread [EMAIL PROTECTED]
Dear Friends,
I have a problm, try to solve that.
Actually there is a table with columns a and b .
So i want if a contains a particular word than a's value should return else
'b' value should return. And there must be one and only one column
returning. I have mysql 4.x and i think the logic will be like. I know i am
wrong by syntax but ...
SELECT IF(a REGEXP CONCAT('word' , '$'),a,b) from table_name where a =
'anything';

I think i am clear if not do please ask me questions.
I shall be very grateful if any one of you can give me a solutions.
--
Regards
Abhishek jain.


mail2web - Check your email from the web at
http://mail2web.com/ .



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: A difficult query- urgent for me

2006-01-15 Thread Jochem van Dieten
On 1/15/06, [EMAIL PROTECTED] wrote:

 Actually there is a table with columns a and b .
 So i want if a contains a particular word than a's value should return else
 'b' value should return.

SELECT
  CASE
WHEN a = 'Good' THEN a
ELSE b
  END
FROM
  table

Jochem


Re: A difficult query- urgent for me

2006-01-15 Thread Rhino

An example of the _data_ would be very helpful here.

For example, let's say this is your data:

Col_ACol_B
-----
aceexpert
doghound
hungryravenous

If you are searching for the word ace, you should find it. You then want 
the SQL to return ace, right?


If you are searching for the word puppy, you won't find it in the first 
column. Which word from the second column do you want to return??? There is 
no obvious reason to prefer any of the different values in the second column 
when the search word does not appear in the first column.


Or do you only have a single row in this table? If so, I'm not sure why you 
want to create a table just to contain these two values; it might be 
justified, depending on what you are doing, but it seems unlikely.


Can you clarify what you are trying to accomplish? Otherwise, it's going to 
be hard to help you.


Also, which version of MySQL are you on, 4.0.x or 4.1.x? It might make a big 
difference to the answer I would give since 4.0.x does not support 
subqueries while 4.1.x does.


Rhino

- Original Message - 
From: [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Sunday, January 15, 2006 10:21 AM
Subject: A difficult query- urgent for me


Dear Friends,
I have a problm, try to solve that.
Actually there is a table with columns a and b .
So i want if a contains a particular word than a's value should return else
'b' value should return. And there must be one and only one column
returning. I have mysql 4.x and i think the logic will be like. I know i am
wrong by syntax but ...
SELECT IF(a REGEXP CONCAT('word' , '$'),a,b) from table_name where a =
'anything';

I think i am clear if not do please ask me questions.
I shall be very grateful if any one of you can give me a solutions.
--
Regards
Abhishek jain.


mail2web - Check your email from the web at
http://mail2web.com/ .



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.18/230 - Release Date: 14/01/2006




--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.18/230 - Release Date: 14/01/2006


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



mysql query urgent!!!

2001-06-12 Thread Kapil Sharma

i,
I have to write simple mysql script. I need folowing things:

Number of people logged in previous 0 to 24 hours
Number of people logged in previous 24.5 to 48 hours
Number of people logged in previous 48.5 to 72 hours
Number of people logged in previous 72.5 hours to 7 days
Number of people logged in previous 7.5 to 14 days
Number of people logged in previous 14.5 days onwards


My tables is as follows:
mysql select * from User limit 1;
+--+---+-+--+
| partner_name | user_name | last_login  | mailbox_size |
+--+---+-+--+
| foo.net  | edward| 2001-06-02 09:37:41 |   229099 |
+--+---+-+--+
1 row in set (0.62 sec)

I also want to save the output to comma delimited file.
Cheers
kapil


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: mysql query urgent!!!

2001-06-12 Thread Bob Hall

i,
I have to write simple mysql script. I need folowing things:

Number of people logged in previous 0 to 24 hours
Number of people logged in previous 24.5 to 48 hours
Number of people logged in previous 48.5 to 72 hours
Number of people logged in previous 72.5 hours to 7 days
Number of people logged in previous 7.5 to 14 days
Number of people logged in previous 14.5 days onwards


My tables is as follows:
mysql select * from User limit 1;
+--+---+-+--+
| partner_name | user_name | last_login  | mailbox_size |
+--+---+-+--+
| foo.net  | edward| 2001-06-02 09:37:41 |   229099 |
+--+---+-+--+
1 row in set (0.62 sec)

I also want to save the output to comma delimited file.
Cheers
kapil

Sir, redefine the last_login column as a timestamp and try the following;

CREATE TEMPORARY TABLE time_groups
SELECT If(
  Unix_timestamp(CURRENT_TIMESTAMP)
  - Unix_timestamp(last_login) = 86400
  , '01 day'
  , If(
   Unix_timestamp(CURRENT_TIMESTAMP)
   - Unix_timestamp(last_login) = 172800
   , '02 days'
   , If(
Unix_timestamp(CURRENT_TIMESTAMP)
- Unix_timestamp(last_login) = 259200
, '03 days'
, If(
 Unix_timestamp(CURRENT_TIMESTAMP)
 - Unix_timestamp(last_login) = 604800
 , '07 days'
 , If(
  Unix_timestamp(CURRENT_TIMESTAMP)
  - Unix_timestamp(last_login) = 1209600
  , '14 days'
  , '14 days'
 )
 )
 )
)
 ) AS time_group
FROM User;

SELECT time_group, Count(*)
FROM time_groups
GROUP BY time_group;

It works on my machine. The time_group values are chosen so that they 
will display in the proper order.

Bob Hall

Know thyself? Absurd direction!
Bubbles bear no introspection. -Khushhal Khan Khatak
MySQL list magic words: sql query database

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php