Re: Omit another where clause from original query

2017-09-20 Thread Hal.sz S.ndor
2017/09/19 17:19 ... Don Wieland: Of these found rows, I want to omit those rows where there are rows found after the END TimeStamp based on ?below ?where clause: WHERE 1 AND apt.appt_status_id IN (16) AND apt.user_id IN (3) AND apt.time_start > ‘1504238399' We are trying to fin

Omit another where clause from original query

2017-09-19 Thread Don Wieland
r ON r.room_id = apt.room_id JOIN tl_users u ON u.user_id = apt.user_id WHERE 1 AND apt.appt_status_id IN (16) AND apt.user_id IN (3) AND apt.time_start BETWEEN '150156' AND '1504238399' GROUP BY c.client_id HAVING count(*) > 0 ORDER BY u.first_name, u

Re: using alias in where clause

2016-01-29 Thread Larry Martell
gt;>>> IFNULL(f_tag_bottom_minor_axis, >>>>>>>> IFNULL(f_tag_ch_x_bottom, >>>>>>>>IFNULL(f_tag_ch_y_bottom, NULL) as ftag, >>>>>>>>STDDEV

Re: using alias in where clause

2016-01-29 Thread shawn l.green
h_x_bottom, f_tag_ch_y_bottom) as ftag, STDDEV(ch_x_top) As Johnny Withers points out, you may repeat the expression in the WHERE-clause: WHERE COALESCE(f_tag_bottom, f_tag_bottom_major_axis, f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) = 'E

Re: using alias in where clause

2016-01-28 Thread Larry Martell
FNULL(f_tag_ch_y_bottom, NULL) as ftag, >>>>>> STDDEV(ch_x_top) >>>>>> >>>>> >>>>> >>>>> >>>>> Of course, this isn't your real problem, but you could use COAL

Re: using alias in where clause

2016-01-28 Thread shawn l.green
may repeat the expression in the WHERE-clause: WHERE COALESCE(f_tag_bottom, f_tag_bottom_major_axis, f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) = 'E-CD7' If really only one of those is not NULL, it is equivalent to this: 'E-CD7' IN (f_tag_b

Re: using alias in where clause

2016-01-28 Thread Larry Martell
> SELECT COALESCE(f_tag_bottom, f_tag_bottom_major_axis, >>> f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) as ftag, >>> STDDEV(ch_x_top) >>> >>> >>> As Johnny Withers points out, you may repe

Re: using alias in where clause

2016-01-28 Thread shawn l.green
tag_bottom, f_tag_bottom_major_axis, f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) as ftag, STDDEV(ch_x_top) As Johnny Withers points out, you may repeat the expression in the WHERE-clause: WHERE COALESCE(f_tag_bottom, f_tag_bottom_

Re: using alias in where clause

2016-01-28 Thread Larry Martell
one): > SELECT COALESCE(f_tag_bottom, f_tag_bottom_major_axis, > f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) as ftag, > STDDEV(ch_x_top) > .... > > As Johnny Withers points out, you may repeat the expression in the > WHERE-clause

Re: using alias in where clause

2016-01-26 Thread Hal.sz S.ndor
STDDEV(ch_x_top) As Johnny Withers points out, you may repeat the expression in the WHERE-clause: WHERE COALESCE(f_tag_bottom, f_tag_bottom_major_axis, f_tag_bottom_minor_axis, f_tag_ch_x_bottom, f_tag_ch_y_bottom) = 'E-CD7' If really only one of those is not NULL,

Re: using alias in where clause

2016-01-25 Thread Johnny Withers
On Mon, Jan 25, 2016 at 9:32 PM, Larry Martell wrote: > On Mon, Jan 25, 2016 at 8:26 PM, Johnny Withers > wrote: > > You should probably turn this into a UNION and put an index on each > column: > > > > SELECT f_tag_ch_y_bottom AS ftag FROM data_cst WHERE f_t

Re: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 8:26 PM, Johnny Withers wrote: > You should probably turn this into a UNION and put an index on each column: > > SELECT f_tag_ch_y_bottom AS ftag FROM data_cst WHERE f_tag_ch_y_bottom = > 'E-CD7' > UNION ALL > SELECT f_tag_ch_x_bottom

Re: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 8:01 PM, Rebecca Love wrote: > Have you tried using a select case statement for ftag? How would that help? Unless I'm missing something, I'd still have to have a reference to the column alias in the where clause. >> On Jan 25, 2016, at 6:39 PM, L

Re: using alias in where clause

2016-01-25 Thread Johnny Withers
You should probably turn this into a UNION and put an index on each column: SELECT f_tag_ch_y_bottom AS ftag FROM data_cst WHERE f_tag_ch_y_bottom = 'E-CD7' UNION ALL SELECT f_tag_ch_x_bottom AS ftag FROM data_cst WHERE f_tag_ch_x_bottom = 'E-CD7' UNION ALL SELECT f_tag_botto

Re: using alias in where clause

2016-01-25 Thread Rebecca Love
Have you tried using a select case statement for ftag? > On Jan 25, 2016, at 6:39 PM, Larry Martell wrote: > > On Mon, Jan 25, 2016 at 7:27 PM, Reindl Harald wrote: >> >> >> Am 26.01.2016 um 01:16 schrieb Larry Martell: >>> >>> I know I ca

Re: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 7:27 PM, Reindl Harald wrote: > > > Am 26.01.2016 um 01:16 schrieb Larry Martell: >> >> I know I cannot use an alias in a where clause, but I am trying to >> figure out how to achieve what I need. >> >> If I could have an alias in a w

Re: using alias in where clause

2016-01-25 Thread Reindl Harald
Am 26.01.2016 um 01:16 schrieb Larry Martell: I know I cannot use an alias in a where clause, but I am trying to figure out how to achieve what I need. If I could have an alias in a where clause my sql would look like this: SELECT IFNULL(f_tag_bottom, IFNULL

using alias in where clause

2016-01-25 Thread Larry Martell
I know I cannot use an alias in a where clause, but I am trying to figure out how to achieve what I need. If I could have an alias in a where clause my sql would look like this: SELECT IFNULL(f_tag_bottom, IFNULL(f_tag_bottom_major_axis, IFNULL

Re: Where is mysql-workbench SCM?

2015-10-16 Thread Karl-Philipp Richter
Found it (after some days of searching): https://code.launchpad.net/ubuntu/+source/mysql-workbench must be the official repository according to https://dev.mysql.com/doc/refman/5.7/en/installing-development-tree.html. -Kalle Am 15.10.2015 um 22:11 schrieb Karl-Philipp Richter: > Hi, > The only li

Where is mysql-workbench SCM?

2015-10-15 Thread Karl-Philipp Richter
Hi, The only list of mysql-related SCM repositories I found was https://github.com/mysql which didn't contain a repository for `mysql-workbench`. I only found the source tarball at http://dev.mysql.com/downloads/workbench/. The development section at http://dev.mysql.com/downloads/workbench/ doesn'

Re: Where to ask a question about installation and configuration

2015-06-23 Thread Claudio Nanni
Hello Steve, To what list should I post with a post-installation config and startup > question? > > This list, the MySQL General Mailing List, is the right place if the question is about MySQL! Cheers -- Claudio

Where to ask a question about installation and configuration

2015-06-23 Thread Steve Matzura
To what list should I post with a post-installation config and startup question? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: Precedence in WHERE clauses.

2014-03-25 Thread shawn l.green
d the specific case I mentioned, my goal is also to get a general discussion about theorical behaviour of MySQL while handling WHERE clauses. I don't have access to the application for now, but will try EXPLAIN as soon as I can . Here is the Result of Explain : http://perso.stux6.net/mysq

Re: Precedence in WHERE clauses.

2014-03-23 Thread Christophe
mentioned, my goal is also to get a general > discussion about theorical behaviour of MySQL while handling WHERE clauses. > > I don't have access to the application for now, but will try EXPLAIN as > soon as I can . Here is the Result of Explain : http://perso.stux6.net/mysql/201

Re: Precedence in WHERE clauses.

2014-03-20 Thread Roy Lyseng
like so: select into DATE_SUB(NOW(), INTERVAL 24 HOUR) INTO @yesterday ; SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN ('PENDING', 'ACCEPTED') AND SubscribeDate < @yesterday); Indeed ! it can be a significant performance improvement ;). Thanks for

Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
while handling WHERE clauses. I don't have access to the application for now, but will try EXPLAIN as soon as I can . Regards, Christophe. Le 19/03/2014 17:12, Morgan Tocker a écrit : > Hi Harald, > >> you can call me Harald > > My apologies! > >> the question

Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
into DATE_SUB(NOW(), INTERVAL 24 HOUR) INTO @yesterday ; > > SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN > ('PENDING', 'ACCEPTED') AND SubscribeDate < @yesterday); > Indeed ! it can be a significant performance improvement ;). Thanks for this .

Re: Precedence in WHERE clauses.

2014-03-19 Thread shawn l.green
On 3/19/2014 7:27 PM, Mogens Melander wrote: G'morning A function in a where equals what ? On Wed, March 19, 2014 15:05, Morgan Tocker wrote: Hi Christophe, Considering the following simple query : SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN ('PENDING&#

Re: Precedence in WHERE clauses.

2014-03-19 Thread Mogens Melander
G'morning A function in a where equals what ? On Wed, March 19, 2014 15:05, Morgan Tocker wrote: > Hi Christophe, > >> Considering the following simple query : >> >> SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN >> ('PENDING',

Re: Precedence in WHERE clauses.

2014-03-19 Thread Reindl Harald
Am 19.03.2014 16:27, schrieb Morgan Tocker: > Reindl, you can call me Harald >>> The order of the WHERE clause does not matter >> >> that is simply not true >> >> otherwise that documentation would not exist >> http://dev.mysql.com/doc/refman/5.5/en/

Re: Precedence in WHERE clauses.

2014-03-19 Thread Morgan Tocker
Reindl, >> The order of the WHERE clause does not matter > > that is simply not true > > otherwise that documentation would not exist > http://dev.mysql.com/doc/refman/5.5/en/multiple-column-indexes.html Yes, the order of the columns in composite indexes *does matter*.

Re: Precedence in WHERE clauses.

2014-03-19 Thread Reindl Harald
Am 19.03.2014 15:05, schrieb Morgan Tocker: > When a MySQL server receives a query, it goes through a process called query > optimization > and tries to determine the best way to execute it (based on availability of > indexes etc) > > The order of the WHERE clause does n

Re: Precedence in WHERE clauses.

2014-03-19 Thread Morgan Tocker
Hi Christophe, > Considering the following simple query : > > SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN > ('PENDING', 'ACCEPTED') AND SubscribeDate < DATE_SUB(NOW(), INTERVAL 24 > HOUR); > > Which of these filters are proc

Re: Precedence in WHERE clauses.

2014-03-19 Thread Glyn Astill
> From: Christophe > To: mysql@lists.mysql.com > Cc: > Sent: Tuesday, 18 March 2014, 19:10 > Subject: Precedence in WHERE clauses. > > Hi list, > > I'd like to get your advice about precedence in where clauses in MySQL > (5.0.51, and 5.1.66 in this c

Re: Precedence in WHERE clauses.

2014-03-18 Thread Michael Dykman
suggest you temporarily memoize that like so: select into DATE_SUB(NOW(), INTERVAL 24 HOUR) INTO @yesterday ; SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN ('PENDING', 'ACCEPTED') AND SubscribeDate < @yesterday); On Tue, Mar 18, 2014 at 3:10 PM, Chris

Precedence in WHERE clauses.

2014-03-18 Thread Christophe
Hi list, I'd like to get your advice about precedence in where clauses in MySQL (5.0.51, and 5.1.66 in this case / from lenny and squeeze Debian packages ). Considering the following simple query : SELECT * FROM Status WHERE DWProcessed = 0 AND PreviousStatus NOT IN ('PENDING',

Re: Nested WHERE

2013-11-21 Thread Jopoy Solano
Awesome! Thank you very much Claudio! :) On Thu, Nov 21, 2013 at 10:40 AM, Claudio Nanni wrote: > Hi Jopoy, > > Try this: > > "SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE > EXTRACT(YEAR_MONTH FROM acctstarttime) >= EXTRACT(YEAR_MONTH FROM

Re: Nested WHERE

2013-11-21 Thread Claudio Nanni
Hi Jopoy, Try this: "SELECT username,sum(acctoutputoctets) AS total_usage FROM radacct WHERE EXTRACT(YEAR_MONTH FROM acctstarttime) >= EXTRACT(YEAR_MONTH FROM CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) < EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP

Nested WHERE

2013-11-21 Thread Jopoy Solano
otal_usage FROM radacct WHERE EXTRACT(YEAR_MONTH FROM acctstarttime) >= EXTRACT(YEAR_MONTH FROM CURRENT_DATE)and EXTRACT(YEAR_MONTH FROM acctstarttime) < EXTRACT(YEAR_MONTH FROM CURRENT_DATE + INTERVAL 1 MONTH) GROUP BY username ORDER BY total_usage DESC;" I wanted to add something

RE: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-24 Thread Rick James
Even if you could block them, they would be easy to get around: SELECT * FROM tbl WHERE 1; If you have long running queries, you should investigate the reasons (other than lack of WHERE). * MyISAM locks the table for any writes. This prevents a SELECT from starting or a select can prevent

RE: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread abhishek jain
age- > From: Martin Gainty [mailto:mgai...@hotmail.com] > Sent: 24 September 2012 04:58 > To: fuller.art...@gmail.com; pownall...@gmail.com > Cc: mysql@lists.mysql.com > Subject: RE: How to block SELECT * FROM table; but not SELECT * FROMT > table WHERE...; > > > Possi

RE: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Martin Gainty
Possibly run your constructed query thru a regex expression e.g. String mydata = "SELECT * from table WHERE a Date: Sun, 23 Sep 2012 18:38:58 -0400 > Subject: Re: How to block SELECT * FROM table; but not SELECT * FROMT table > WHERE...; > From: fuller.art...@gmail.com > To: pow

Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Arthur Fuller
Tim, I think you misunderstood the question. Daniel wants to block Select queries that ask for all rwows, and permit only queries that ask for some rows, as restricted by the Where clause. Unfortunately, I don't think that can be done. But I'm not certain of that; there might be a tric

Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Reindl Harald
that does not change the fact that it is valid to NOT have a where statement and for me it sound plain stupid to think about blocking queries without where-statements - the application developers will hopefully kill any admin who finds a solution for this... * i maintain a cms-system

Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Tim Pownall
select * from table where column=value means it will return only rows that match. as long as you have proper indexing there should not be any issues. On Sun, Sep 23, 2012 at 1:23 PM, Luis Daniel Lucio Quiroz < luis.daniel.lu...@gmail.com> wrote: > Helo, > > Just wondering if

Re: How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Reindl Harald
Am 23.09.2012 20:23, schrieb Luis Daniel Lucio Quiroz: > Just wondering if is possible to block SELECT queries that doesnt have > a WHERE statement within. no and the idea is broken by design what is wrong with a "select * from table" with small tbales having only a handful

How to block SELECT * FROM table; but not SELECT * FROMT table WHERE...;

2012-09-23 Thread Luis Daniel Lucio Quiroz
Helo, Just wondering if is possible to block SELECT queries that doesnt have a WHERE statement within. LD -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql

Re: distinct & count operation with the use of "where count > $num"

2012-06-17 Thread Tsubasa Tanaka
Hi, you have to use `HAVING' instead of `WHERE' like this. SELECT DISTINCT `term`, COUNT(*) AS count FROM blp_sql_distinct_temp_table GROUP BY `term` HAVING count >= 5 ORDER BY count DESC; put `HAVING' next of `GROUP BY'. `WHERE' behaves at before aggregate of `GR

distinct & count operation with the use of "where count > $num"

2012-06-17 Thread Haluk Karamete
Hi, I'm trying to get this work; SELECT distinct `term`,count(*) as count FROM blp_sql_distinct_temp_table where count >= 5 group by `term` order by count DESC But I get this error; Unknown column 'count' in 'where clause' How do I get only those records who

Re: USING WHERE; USING TEMPORARY; USING filesort

2012-02-24 Thread Perrin Harkins
On Thu, Feb 23, 2012 at 5:50 PM, Daevid Vincent wrote: > Anyone have any thoughts on how I might optimize this query? As always, it's all about the indexes. The index it chose on your main table looks pretty weak. You probably should move those non-joining columns out of your join condition in

Re: USING WHERE; USING TEMPORARY; USING filesort

2012-02-24 Thread Johan De Meersman
- Original Message - > From: "Daevid Vincent" > > d.`date_release`!='-00-00' AND sd.`scene_id`=s.`scene_id` GROUP > BY sg.`scene_id` ORDER BY num DESC, sd.`count_dl_monthly` DESC LIMIT 30; Could you put an index on sg.scene_id? Not sure, but it might help the grouping be more effici

USING WHERE; USING TEMPORARY; USING filesort

2012-02-23 Thread Daevid Vincent
scenes_genres` AS sg, `scenes_downloads_new` AS sd WHERE sg.`genre_id` IN ('1','8','10','19','38','58','65') AND d.`dvd_id`=s.`dvd_id` AND sg.`scene_id`=s.`scene_id` AND d.`status`='ok' AND d.`date_release`!='-00-00'

Re: credit where due

2011-10-19 Thread Sabika M
I also want to say Thank you Shawn for your valuable contribution. On the note on Resumes -I thought I would put it out here. My company is looking for an excellent MySQL DBA (Oracle and MSSQL experience a plus) Please send me your resume. Thanks! Sabika On Wed, Oct 19, 2011 at 12:30 PM, Shawn Gr

Re: credit where due

2011-10-19 Thread Shawn Green (MySQL)
On 10/19/2011 13:29, Michael Dykman wrote: While we have him online, I think we could all take a moment and be grateful for the contributions of Shawn Green. When I see the Oracle-bashing on this list, I am often reminded that we still have a hard-core MySQL developer who has survived the ride t

Re: credit where due

2011-10-19 Thread Nick Khamis
Thanks Shawn! Ninus from Montreal. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

Re: credit where due

2011-10-19 Thread David Giragosian
On Wed, Oct 19, 2011 at 12:29 PM, Michael Dykman wrote: > While we have him online, I think we could all take a moment and be > grateful > for the contributions of Shawn Green. > > When I see the Oracle-bashing on this list, I am often reminded that we > still have a hard-core MySQL developer who

credit where due

2011-10-19 Thread Michael Dykman
While we have him online, I think we could all take a moment and be grateful for the contributions of Shawn Green. When I see the Oracle-bashing on this list, I am often reminded that we still have a hard-core MySQL developer who has survived the ride to Sun and again to Oracle who is still provid

Re: Update on inner join - looks good to me, where did I go wrong?

2011-09-10 Thread Dotan Cohen
On Sat, Sep 10, 2011 at 01:48, Carsten Pedersen wrote: > `userTable.userid` => `userTable`.`userid` > Thank you Carsten. That was indeed the problem! Have a peaceful weekend. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- MySQL General Mailing List For list archives: http:/

Re: Update on inner join - looks good to me, where did I go wrong?

2011-09-09 Thread Carsten Pedersen
le` ->ON `userTable.userid`=`anotherTable.userid` -> SET `userTable.someField`="Jimmy Page" -> WHERE `userTable.someField`="Jim Morrison" ->AND `anotherTable.date`< NOW(); ERROR 1054 (42S22): Unknown column 'userTable.someField

Re: Update on inner join - looks good to me, where did I go wrong?

2011-09-09 Thread Dotan Cohen
Now that I've got the syntax right, MySQL is complaining that a field does not exist, which most certainly does: mysql> UPDATE -> `userTable` -> INNER JOIN `anotherTable` -> ON `userTable.userid`=`anotherTable.userid` -> SET `userTable.someField`="

Update on inner join - looks good to me, where did I go wrong?

2011-09-09 Thread Dotan Cohen
I'm trying to update on an join, but I can't find my error: UPDATE `userTable` SET `someField`="Jimmy Page" FROM `userTable` INNER JOIN `anotherTable` ON `userTable.userid`=`anotherTable.userid` WHERE `userTable.someField`="Jim Morrison" AND `anotherTable.dat

Re: Using where; Using temporary; Using filesort

2011-05-31 Thread Peter Brawley
> Is it ALWAYS possible to fabricate a query/schema in > such a way that MySQL ALWAYS uses the ideal No. Optimisation is better in 5.6 than in 5.0, though. Did you try adding multi-column indexes to cover the join and the order by clause? > 'Using where' extra -- you just

Using where; Using temporary; Using filesort

2011-05-31 Thread Daevid Vincent
I sent this Friday, but it never made it to the list?! -Original Message- From: Daevid Vincent [mailto:dae...@daevid.com] Sent: Friday, May 27, 2011 12:27 PM To: mysql@lists.mysql.com Subject: Using where; Using temporary; Using filesort I'm trying to optimize a query that doesn&#

Re: Using where; Using temporary; Using filesort

2011-05-31 Thread Hal�sz S�ndor
s 2011/05/27 12:26 -0700, Daevid Vincent [a] the EXTENDED keyword doesn't seem to do anything different? I get the same columns and results??! "show warnings" 2011/05/27 12:26 -0700, Daevid Vincent In other words, am I wasting my time trying to tweak my query and indexe

Using where; Using temporary; Using filesort

2011-05-31 Thread Daevid Vincent
status,status_release key: status_release key_len: 1 ref: const rows: 1976 Extra: Using where; Using temporary; Using filesort *** 2. row *** id: 1 select_type: SIMPLE table: s type:

Re: URGENT: Change Default Location of where Database Files get written?

2011-05-13 Thread Andrew Moore
sql > > When creating a new database, a folder (with the name of the databas) gets > created in this location: > /opt/mysql/data > > Is there any way to change the location of where data is stored? > The database that I need to create is going to have over a billion records

Re: URGENT: Change Default Location of where Database Files get written?

2011-05-13 Thread Larry Martell
a folder (with the name of the databas) gets > created in this location: > /opt/mysql/data > > Is there any way to change the location of where data is stored? > The database that I need to create is going to have over a billion records > in it, > so it needs to be in a speci

Re: URGENT: Change Default Location of where Database Files get written?

2011-05-13 Thread Wm Mussatto
older (with the name of the databas) > gets created in this location: > /opt/mysql/data > > Is there any way to change the location of where data is stored? > The database that I need to create is going to have over a billion > records in it, > so it needs to be in a specific

RE: URGENT: Change Default Location of where Database Files get written?

2011-05-13 Thread David Brian Chait
Add: datadir=/path/to/datadir/mysql to your my.cnf file and restart mysql. -Original Message- From: Tina Matter [mailto:ti...@umich.edu] Sent: Friday, May 13, 2011 8:22 AM To: mysql@lists.mysql.com Subject: URGENT: Change Default Location of where Database Files get written? I have a

URGENT: Change Default Location of where Database Files get written?

2011-05-13 Thread Tina Matter
mysql/data Is there any way to change the location of where data is stored? The database that I need to create is going to have over a billion records in it, so it needs to be in a specific place. I want the database folder to get created here: /science/databases/databasename Thanks for any

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
>>>> 2011/04/26 17:55 +0300, Andre Polykanine >>>> Aha. So, I should write SELECT `Blogs`.* INNER JOIN `Users` ON `Users`.`Id`=`Blogs`.`UserId` instead of my original WHERE clause? Thanks! <<<<<<<< I think so. -- MySQL General Mailin

Re: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-26 Thread Daniel Kraft
On 04/26/11 05:32, Halász Sándor wrote: 2011/04/25 18:45 +, Larry McGhaw CREATE VIEW `myview2` AS SELECT a.*, IF(b.`Name` IS NULL, '', b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; Well, for this construct IF(b.`N

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Andre Polykanine
Hello Halбsz, Aha. So, I should write SELECT `Blogs`.* INNER JOIN `Users` ON `Users`.`Id`=`Blogs`.`UserId` instead of my original WHERE clause? Thanks! -- With best regards from Ukraine, Andre Skype: Francophile My blog: http://oire.org/menelion (mostly in Russian) Twitter: http

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Suresh Kuna
I would go with join rather than where condition. 2011/4/26 Halász Sándor > >>>> 2011/04/25 17:42 +0300, Andre Polykanine >>>> > Here is the first one. > We have two queries: > SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON > `Blogs`.`Us

Re: LEFT JOIN and WHERE: identical or not and what is better?, etc.

2011-04-26 Thread Hal�sz S�ndor
>>>> 2011/04/25 17:42 +0300, Andre Polykanine >>>> Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users`

RE: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-26 Thread Hal�sz S�ndor
2011/04/25 18:45 +, Larry McGhaw CREATE VIEW `myview2` AS SELECT a.*, IF(b.`Name` IS NULL, '', b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; Well, for this construct IF(b.`Name` IS NULL, '', b.`Name`) there is a spe

Re: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-25 Thread Daniel Kraft
outer join). This particular set of circumstances seems to cause MySQL to treat the resulting expression as "unknown" when used in a where clause on the view itself - such that any use of the expression in the where clause will evaluate to unknown/false. As a workaround - thi

RE: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-25 Thread Larry McGhaw
particular set of circumstances seems to cause MySQL to treat the resulting expression as "unknown" when used in a where clause on the view itself - such that any use of the expression in the where clause will evaluate to unknown/false. As a workaround - this view for example behaves a

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Joerg Bruehe
> questions, please bear with me. > Here is the first one. > We have two queries: > SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON > `Blogs`.`UserId`=`Users`.`Id`; > and the following one: > SELECT `Blogs`.* FROM `Blogs`, `Users`

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Johnny Withers
need all blogs, even those without a matching user (can that even occur?), the first one is better. I prefer to write the INNER JOIN out though because it leaves my WHERE clause to do filtering. JW On Mon, Apr 25, 2011 at 9:42 AM, Andre Polykanine wrote: > Hello everyone, > Sorry for

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Jo�o C�ndido de Souza Neto
ing stupid questions, please bear with me. Here is the first one. We have two queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`=`

Re: LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Mitchell Maltenfort
'where' is a filter. You're limiting records based on a criterion. 'on' is used for joining. On Mon, Apr 25, 2011 at 10:42 AM, Andre Polykanine wrote: > Hello everyone, > Sorry for my beginner question. Actually I have been using MySql for a > long  time  b

LEFT JOIN and WHERE: identical or not and what is better?

2011-04-25 Thread Andre Polykanine
queries: SELECT `blogs`.* FROM `Blogs` LEFT JOIN `Users` ON `Blogs`.`UserId`=`Users`.`Id`; and the following one: SELECT `Blogs`.* FROM `Blogs`, `Users` WHERE `Blogs`.`UserId`=`Users`.`Id`; 1. Are they identical? 2. Which is better (faster, more optimal

Re: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-24 Thread Daniel Kraft
1 | ++--+--+--+--+ 1 row in set (0.00 sec) But when referenced in the where clause in any manner, no results are returned. mysql> SELECT *, TypeName Is NULL, TypeName IS NOT NULL FROM `myview` where TYPE NAME IS NOT NULL; Empty set (0.00 sec) -Original M

Re: WHERE does not work on calculated view field

2011-04-23 Thread Daniel Kraft
ID of entries in mytable (customers, say) to IDs of types, which doesn't make much sense to me. Or did I get this wrong? (As I said, I'm more of less learning-by-doing and no expert!) Yours, Daniel Now your select queries will give results as follows: mysql> SELECT COUNT(*

Re: WHERE does not work on calculated view field

2011-04-23 Thread ars k
will give results as follows: mysql> SELECT COUNT(*) FROM `myview2` WHERE `TypeName` LIKE '%'; +--+ | COUNT(*) | +--+ |1 | +--+ 1 row in set (0.00 sec) mysql> SELECT COUNT(*) FROM `myview2` WHERE `TypeName` IS NOT NULL; +--+ | COUNT(*) | +---

Re: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-22 Thread Carsten Pedersen
On 22.04.2011 22:41, Larry McGhaw wrote: It does appear to be some type of bug to me. I agree. I was thrown by Daniels "first and third" comment, which I guess should read "second and third" I reproduced the behavior in 5.1.53-community on Windows. / Carsten -- MySQL General Mailing List F

RE: WHERE does not work on calculated view field - Found word(s) list error in the Text body

2011-04-22 Thread Larry McGhaw
ULL | TypeName IS NOT NULL | ++--+--+--+--+ | 1 | NULL | |0 |1 | ++--+--+--+--+ 1 row in set (0.00 sec) But when referenced in the where clause in

Re: WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
LIMITER ; CREATE VIEW `myview` AS SELECT a.*, EMPTY_STRING(b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS NULL; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS NOT NULL; SELECT COUNT(*) FROM `myview` WHERE `Ty

Re: WHERE does not work on calculated view field

2011-04-22 Thread Carsten Pedersen
ING` (value TEXT) RETURNS TEXT DETERMINISTIC BEGIN RETURN IF(value IS NULL, '', value); END| DELIMITER ; CREATE VIEW `myview` AS SELECT a.*, EMPTY_STRING(b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS N

Re: WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
END| DELIMITER ; CREATE VIEW `myview` AS SELECT a.*, EMPTY_STRING(b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS NULL; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS NOT NULL; SELECT COUNT(*)

RE: WHERE does not work on calculated view field

2011-04-22 Thread Daevid Vincent
> -Original Message- > From: Daniel Kraft [mailto:d...@domob.eu] > Sent: Friday, April 22, 2011 12:37 PM > To: mysql@lists.mysql.com > Subject: WHERE does not work on calculated view field > > Hi all, > > I'm by no means a (My)SQL expert and just gett

WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
T DETERMINISTIC BEGIN RETURN IF(value IS NULL, '', value); END| DELIMITER ; CREATE VIEW `myview` AS SELECT a.*, EMPTY_STRING(b.`Name`) AS `TypeName` FROM `mytable` a LEFT JOIN `types` b ON a.`Type` = b.`ID`; SELECT COUNT(*) FROM `myview` WHERE `TypeName` IS NULL; SELECT CO

Re: Unknown column 'users.users_id' in 'where clause'

2011-02-04 Thread Tompkins Neil
Thanks, but how can I pass the current users value from the other query ? On Thu, Feb 3, 2011 at 4:22 PM, Simcha Younger wrote: > On Thu, 3 Feb 2011 13:55:36 + > Tompkins Neil wrote: > > > SELECT DISTINCT(away_teams_id) AS teams_id > > FROM fixtu

Re: Unknown column 'users.users_id' in 'where clause'

2011-02-03 Thread Simcha Younger
On Thu, 3 Feb 2011 13:55:36 + Tompkins Neil wrote: > SELECT DISTINCT(away_teams_id) AS teams_id > FROM fixtures_results > WHERE (fixtures_results.away_users_id = *users.users_id*) > Any ideas why I'm getting Unknown column 'users.users_id' in 'where clause&

Unknown column 'users.users_id' in 'where clause'

2011-02-03 Thread Tompkins Neil
Hi, I've the following SELECT statement SELECT users.gamer_tag, UNIX_TIMESTAMP(users.created_on) AS time_registered, (SELECT fixtures_results.last_changed FROM fixtures_results WHERE (home_users_id = users.users_id AND home_teams_id = users_teams.teams_id) OR (away_users_id = users.users_i

Re: Help with Date in Where Clause

2011-01-31 Thread Bruce Ferrell
On 01/31/2011 12:18 PM, Jørn Dahl-Stamnes wrote: > On Monday 31 January 2011 21:12, Phillip Baker wrote: > >> Greetings All, >> >> I am looking for a little help in setting a where clause. >> I have a dateAdded field that is a DATETIME field. >> I am look

Re: Help with Date in Where Clause

2011-01-31 Thread Shawn Green (MySQL)
On 1/31/2011 15:12, Phillip Baker wrote: Greetings All, I am looking for a little help in setting a where clause. I have a dateAdded field that is a DATETIME field. I am looking to pull records from Midnight to midnight the previous day. I thought just passing the date (without time) would get

Re: Help with Date in Where Clause

2011-01-31 Thread Phillip Baker
Thank you very much Jørn Blessed Be Phillip "Never ascribe to malice what can be explained by incompetence" -- Hanlon's Razor On Mon, Jan 31, 2011 at 1:18 PM, Jørn Dahl-Stamnes wrote: > Jørn

Re: Help with Date in Where Clause

2011-01-31 Thread Jørn Dahl-Stamnes
On Monday 31 January 2011 21:12, Phillip Baker wrote: > Greetings All, > > I am looking for a little help in setting a where clause. > I have a dateAdded field that is a DATETIME field. > I am looking to pull records from Midnight to midnight the previous day. > I thought jus

  1   2   3   4   5   6   7   8   9   10   >