Re: What charset to use for greek character Β?

2011-10-16 Thread Peng Yu
Hi, I just realized that the problem is that I also need to specify charset for load data. Once the utf8 is specified for 'load data', then the problem is solved. Please ignore my previous email. Thanks! ~/linux/test/mysql/mysql/LOAD_DATA/CHARACTER_SET$ cat main.sql use test CREATE TEMPORARY TABL

What charset to use for greek character Β?

2011-10-16 Thread Peng Yu
Hi, I have the greek character "Β" (not that it is different from the English character "B", although they look similar. Copy both of them and type in google search box, you will see different search suggestion pop up). utf8 in mysql seems doesn't work. I'm wondering what charset I should for thi

Re: User defined Variables

2011-10-16 Thread Dan Nelson
In the last episode (Oct 16), Kailash R said: > Nice input Dan. Let me run some checks. My query is as follows: > > select group_concat(Field1), field2, field3 from table1 group by field2, > field3 into str; > @sql = concat("select blah ... where field1 in ' ,str); > prepare stmt from @sql; > exe

Re: How to enable tabular output when reading command from file?

2011-10-16 Thread Dan Nelson
In the last episode (Oct 16), Peng Yu said: > Hi, > > ~/linux/test/mysql/mysql/SELECT$ ./main.sh > name datetyperemark > Fluffy1995-05-15 litter 4 kittens, 3 female, 1 male > Buffy 1993-06-23 litter 5 puppies, 2 female, 3 male > Buffy 1994-06-19 litter 3 puppies,

Generate errors when loading table

2011-10-16 Thread Peng Yu
Hi, I have the following table and sql commands. The number of fields in the file is different from that of the schema. And the last line should not contain null. But there are only warnings but not errors generated. I'm wondering how to generate errors instead of warnings. ~/linux/test/mysql/mys

Re: User defined Variables

2011-10-16 Thread Kailash R
Nice input Dan. Let me run some checks. My query is as follows: select group_concat(Field1), field2, field3 from table1 group by field2, field3 into str; @sql = concat("select blah ... where field1 in ' ,str); prepare stmt from @sql; execute stmt; deallocate prepare stmt; So when the count(*) for

How to enable tabular output when reading command from file?

2011-10-16 Thread Peng Yu
Hi, ~/linux/test/mysql/mysql/SELECT$ ./main.sh namedatetyperemark Fluffy 1995-05-15 litter 4 kittens, 3 female, 1 male Buffy 1993-06-23 litter 5 puppies, 2 female, 3 male Buffy 1994-06-19 litter 3 puppies, 3 female Chirpy 1999-03-21 vet needed beak stra

Re: [MYSQL] INTERSECT, MINUS

2011-10-16 Thread Suresh Kuna
Hi, EXISTS function provides a simple way to find intersection between tables (INTERSECT operator from relational model). If we have table1 and table2, both having id and value columns, the intersection could be calculated like this: SELECT * FROM table1 WHERE EXISTS(SELECT * FROM table2 WHERE t

[MYSQL] INTERSECT, MINUS

2011-10-16 Thread Grega Leskovšek
WHat is wring with the following three sentences? SELECT p.name, p.gender, e.pizza FROM Person p, Eats e WHERE p.name = e.name AND p.gender = 'female' AND (e.pizza = 'mushroom') INTERSECT SELECT p.name, p.gender, e.pizza FROM Person p, Eats e WHERE p.name = e.name AND p.gender = 'female' AND (e.pi