Re: Select question

2007-10-25 Thread Ralf Hüsing

Matthew Stuart schrieb:

> I've got this statement to select the last two entries in my db:
>
> SELECT top 2 *
> FROM Content
> ORDER BY ContentID desc
>
> and it works fine because it selects the last two items entered into 
the db. However, I only want to be able to select item 2 rather than 
both 1 and 2. How do I do that?


Hi Mat,

"TOP 2" is not MySQL?

However, MySQL knows LIMIT [1] which is more powerful, try:

  SELECT *
  FROM Content
  ORDER BY ContentID DESC
  LIMIT 1,1

regards
  -Ralf

[1]: http://dev.mysql.com/doc/refman/5.0/en/select.html


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



OT: "K.I.S.S."? Re: Left outer joins, where clause and table_names

2007-10-24 Thread Ralf Hüsing

tom wang schrieb:

Hi,

I have the following sql request:

SELECT projects.`id` AS t0_r0, projects.`name` AS

[..endless sql..]

Hi Tom,

did you understand that query (in lets say 3 months) if you need to fix 
a bug? If not it maybe better to simplify that.


regards
  -ralf

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



[OT] Memory Usage on Windows? Re: Replication still stopping...

2007-10-22 Thread Ralf Hüsing

Hi Jesse,


071020 14:43:51  InnoDB: Started; log sequence number 0 142497221
071020 14:43:51 [Note] C:\Program Files\MySQL\MySQL Server
5.0\bin\mysqld-nt: ready for connections.


as i can see you are running mysql on windows.

If i start my db server (5.0.45/innodb/win2k) the server uses about ~80K 
handles (as seen in taskmgr) and memory usage increases around 1g.

Taskmgr.exe says that there is some swapping (the box has only 1gb ram).

The DB itself is small (~50mb or so).

My Question is, did you have the same things on your box?
Did you have performace issues which resultes from the memory usage?

Thanks
  Ralf

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



german datetime format?

2007-10-19 Thread Ralf Hüsing

Hi,

can i change the datetime format on mysql in a german format?

At the moment the dates are stored like "2007-10-19 19:06:17" but if i 
send a query (which comes from user input) the query looks like "WHERE 
Datum >= '19.10.2007'" and i got not what i want.


iam using mysql (5.0.45) on (german) windows 2000,
clients are connected via ODBC-Driver (3.51.21.00) and the
application is using ADODB (mdac-lastest version).

thanks
  Ralf

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



Re: finding non-ascii characters within a string

2007-10-18 Thread Ralf Hüsing

Olav Mørkrid schrieb:
> hello
>
> i would like to search a table column for a range of non-ascii
> characters, or a particular non-ascii character. how can i do this?

Maybe via a inverted regular expression [1] like this?:

  SELECT * FROM  WHERE  RLIKE '[^-, a-zA-Z0-9]'


[1]: http://dev.mysql.com/doc/refman/5.1/en/regexp.html

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



Bug?: "SELECT *, Field" vs. "SELECT Field, *"

2007-10-17 Thread Ralf Hüsing

Hi,

When i try:

  "SELECT *, id FROM "

all is fine.

But if i want the "*" at the end (because the table is large)
i try:

  "SELECT id, * FROM "

and got:

You have an error in your SQL syntax; check the manual that corresponds 
to your MySQL server version for the right syntax to use near '*  FROM 
' at line 1


I think this is a bug?

It works when i try:

  "SELECT id, .* FROM "

The Same thing is:

  "SELECT *, * FROM " (which possibly makes no sense)

-Ralf

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