Re: Selecting rows by DATE ranges

2007-06-23 Thread Pintér Tibor

date(), date_format()

t

Miguel Cardenas írta:

Hello list

I found a little problem with an application am developing, in particular 
creating reports by DATE ranges.


Examples:

select ... where date>"2007-01-01";
returns all records where date is greater (and equal inclusive) to 2007-01-01

select ... where date>="2007-01-01";
returns all records where date is greater/equal to 2007-01-01

the ">" and ">=" have the same effect

select ... where date>"2007-01-01" and date<"2007-01-20";
returns all records where date is greater/equal to 2007-01-01 and less 
than "2007-01-20"

*** DOES NOT RETURN RECORDS FROM DAY *20*

select ... where date>"2007-01-01" and date<="2007-01-20";
returns all records where date is greater/equal to 2007-01-01 and less 
than "2007-01-20" although I'm using "<="

*** DOES NOT RETURN RECORDS FROM DAY *20*

My doubts are:

1. how can I retrieve rows with a date>"..." NOT INCLUDING the day of the 
specified date, I mean apply a strict GREATHER THAN


2. how can I retrieve rows with date<="..." INCLUDING the day of the specified 
date. currently I have to do a date>="date1" and date<="date2+1day"


I need to retrieve rows in this way

date>X
date>=X
dateX and date=X and date=X and date<=Y
date>X and date<=Y

and so... didn't find a function to specify ranges of dates and the LESS 
THAN/EQUAL operator does not include the last day, so my reports with "<=" 
are done by adding one day but don't like to use it this way since it could 
be confusing and generate errors on reports.


Thanks for any comment,
Miguel



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



Accented characters in InnoDB tables?

2007-06-23 Thread patrick

Do you have to do something special with InnoDB tables to accept
various character sets like accented, European characters? Using the
default, these accented characters come out as garbage.

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



Selecting rows by DATE ranges

2007-06-23 Thread Miguel Cardenas
Hello list

I found a little problem with an application am developing, in particular 
creating reports by DATE ranges.

Examples:

select ... where date>"2007-01-01";
returns all records where date is greater (and equal inclusive) to 2007-01-01

select ... where date>="2007-01-01";
returns all records where date is greater/equal to 2007-01-01

the ">" and ">=" have the same effect

select ... where date>"2007-01-01" and date<"2007-01-20";
returns all records where date is greater/equal to 2007-01-01 and less 
than "2007-01-20"
*** DOES NOT RETURN RECORDS FROM DAY *20*

select ... where date>"2007-01-01" and date<="2007-01-20";
returns all records where date is greater/equal to 2007-01-01 and less 
than "2007-01-20" although I'm using "<="
*** DOES NOT RETURN RECORDS FROM DAY *20*

My doubts are:

1. how can I retrieve rows with a date>"..." NOT INCLUDING the day of the 
specified date, I mean apply a strict GREATHER THAN

2. how can I retrieve rows with date<="..." INCLUDING the day of the specified 
date. currently I have to do a date>="date1" and date<="date2+1day"

I need to retrieve rows in this way

date>X
date>=X
dateX and date=X and date=X and date<=Y
date>X and date<=Y

and so... didn't find a function to specify ranges of dates and the LESS 
THAN/EQUAL operator does not include the last day, so my reports with "<=" 
are done by adding one day but don't like to use it this way since it could 
be confusing and generate errors on reports.

Thanks for any comment,
Miguel

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



how can i set configurations variables per user ?

2007-06-23 Thread Amr Elgbaly

Hello !
how can i set mysql configurations variables per user
for example i want limit connections per user to 50 and exclude some users
from this limitation


Regards , :)

--
ِAmr Elgbaly,
GNU/Linux system Engineer


Re: duplicate key question

2007-06-23 Thread Steve Edberg

At 10:19 PM -0500 6/22/07, Chris W wrote:
when you get a duplicate key error it says something to the effect 
of "Duplicate entry 'xyz' for key x"

What I want to know is how to find out what table fields are part of key x?



'show index' is what you want, I think:

http://dev.mysql.com/doc/refman/5.0/en/show-index.html

Example:

[EMAIL PROTECTED]> create table test (c1 int, c2 int, index 
i1 (c1,c2));

Query OK, 0 rows affected (0.02 sec)

[EMAIL PROTECTED]> show index from test\G
*** 1. row ***
   Table: test
  Non_unique: 1
Key_name: i1
Seq_in_index: 1
 Column_name: c1
   Collation: A
 Cardinality: NULL
Sub_part: NULL
  Packed: NULL
Null: YES
  Index_type: BTREE
 Comment:
*** 2. row ***
   Table: test
  Non_unique: 1
Key_name: i1
Seq_in_index: 2
 Column_name: c2
   Collation: A
 Cardinality: NULL
Sub_part: NULL
  Packed: NULL
Null: YES
  Index_type: BTREE
 Comment:
2 rows in set (0.00 sec)

steve



--
Chris W
KE5GIX

"Protect your digital freedom and privacy, eliminate DRM, learn more 
at http://www.defectivebydesign.org/what_is_drm";


Gift Giving Made Easy
Get the gifts you want & give the gifts they want
One stop wish list for any gift, from anywhere, for any occasion!
http://thewishzone.com



--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

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