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 find For

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.last_name, c.last_n

Re: using alias in where clause

2016-01-29 Thread shawn l.green
LESCE(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: WHERE COALESCE(f_tag_bottom, f_tag

Re: using alias in where clause

2016-01-29 Thread Larry Martell
IFNULL(f_tag_ch_y_bottom, NULL) as ftag, >>>>>>>>STDDEV(ch_x_top) >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>

Re: using alias in where clause

2016-01-28 Thread Larry Martell
u don't need the last 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 i

Re: using alias in where clause

2016-01-28 Thread shawn l.green
ALESCE(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: WHERE COALESCE(f_tag_bottom, f_tag_bottom_majo

Re: using alias in where clause

2016-01-28 Thread shawn l.green
DEV(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, it is equivalent to this:

Re: using alias in where clause

2016-01-28 Thread Larry Martell
nd you don't need the last 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

Re: using alias in where clause

2016-01-28 Thread Larry Martell
; Of course, this isn't your real problem, but you could use COALESCE >>>>> instead >>>>> of all those IFNULLs (and you don't need the last one): >>>>> SELECT COALESCE(f_tag_bottom, f_tag_bottom_major_axis, >>>>> f_tag_bottom_mino

Re: using alias in where clause

2016-01-26 Thread Hal.sz S.ndor
(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, it is equivalent

Re: using alias in where clause

2016-01-25 Thread Johnny Withers
; 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_bottom_minor_axis AS ftag FROM da

Re: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 8:26 PM, Johnny Withers <joh...@pixelated.net> 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_

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_bottom_minor_axis AS ftag

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

Re: using alias in where clause

2016-01-25 Thread Rebecca Love
chrieb 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: >>> >>> SELEC

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: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 7:27 PM, Reindl Harald <h.rei...@thelounge.net> 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. >> >>

Re: using alias in where clause

2016-01-25 Thread Larry Martell
On Mon, Jan 25, 2016 at 8:01 PM, Rebecca Love <wacce...@gmail.com> 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

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

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/

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
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/mysql/20140323

Re: Precedence in WHERE clauses.

2014-03-23 Thread Christophe
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/20140323/EXPLAIN.txt I don't really know what is tells

Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
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 . Regards, Christophe. -- MySQL General Mailing List For list

Re: Precedence in WHERE clauses.

2014-03-20 Thread Christophe
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 was is there any performance impact

Re: Precedence in WHERE clauses.

2014-03-20 Thread Roy Lyseng
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); Indeed ! it can be a significant performance improvement ;). Thanks for this . Actually

Re: Precedence in WHERE clauses.

2014-03-19 Thread Glyn Astill
From: Christophe t...@stuxnet.org 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 case / from lenny and squeeze Debian

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 processed first ? I'd like the first filter

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 not matter that is simply

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*. This is a different question

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/multiple-column-indexes.html Yes, the order

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', 'ACCEPTED') AND SubscribeDate DATE_SUB(NOW(), INTERVAL

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', 'ACCEPTED

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', 'ACCEPTED

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, Christophe t...@stuxnet.org

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 claudio.na...@gmail.comwrote: 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 BY username HAVING

Nested WHERE

2013-11-21 Thread Jopoy Solano
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 like a WHERE total_usage 322100

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

2012-09-24 Thread abhishek jain
- 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...; Possibly run your constructed query thru

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

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: 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 of records? how

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 is possible to block

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 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 trick. Arthur

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 ab;; Pattern pattern = Pattern.compile('WHERE'); Matcher matcher = pattern.matcher(mydata); if (matcher.find()) { //WHERE clause found proceed normally } else throw new Exception(WHERE

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 whose group by count is above 5

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 `GROUP BY'. your SQL means like

Re: USING WHERE; USING TEMPORARY; USING filesort

2012-02-24 Thread Johan De Meersman
- Original Message - From: Daevid Vincent dae...@daevid.com 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

Re: USING WHERE; USING TEMPORARY; USING filesort

2012-02-24 Thread Perrin Harkins
On Thu, Feb 23, 2012 at 5:50 PM, Daevid Vincent dae...@daevid.com 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

USING WHERE; USING TEMPORARY; USING filesort

2012-02-23 Thread Daevid Vincent
, `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' AND sd.`scene_id`=s.`scene_id` GROUP BY sg.`scene_id` ORDER BY num DESC, sd.`count_dl_monthly` DESC LIMIT 30

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

Re: credit where due

2011-10-19 Thread David Giragosian
On Wed, Oct 19, 2011 at 12:29 PM, Michael Dykman mdyk...@gmail.com 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

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 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

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

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 cars...@bitbybit.dk 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

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.date` NOW(); ERROR 1064 (42000): You

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`=Jimmy Page - WHERE

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

2011-09-09 Thread Carsten Pedersen
` -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' in 'field list' mysql mysql SELECT count(someField) FROM userTable

Using where; Using temporary; Using filesort

2011-05-31 Thread Daevid Vincent
: 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: ref possible_keys: dvd_id_2,dvd_id

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 indexes here with the idea

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't seem

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 have to keep

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

2011-05-13 Thread Tina Matter
/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 help

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

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

2011-05-13 Thread Wm Mussatto
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 place. I want the database folder to get created here

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

2011-05-13 Thread Larry Martell
(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 place. I want the database folder

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

2011-05-13 Thread Andrew Moore
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 in it, so it needs to be in a specific place

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 special function

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` WHERE `Blogs`.`UserId`=`Users

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 h...@tbbs.net 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

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: 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.`Name` IS NULL,

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 Mailing List For list archives: http://lists.mysql.com/mysql

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: 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 an...@oire.org wrote: Hello everyone, Sorry for my beginner question. Actually I have been using MySql for a long  time  but  I  just  start  using

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

2011-04-25 Thread Jo�o C�ndido de Souza Neto
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 Johnny Withers
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 an...@oire.org wrote: Hello everyone, Sorry

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

2011-04-25 Thread Joerg Bruehe
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`=`Users`.`Id`; 1

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

2011-04-25 Thread Larry McGhaw
). 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 - this view for example behaves as expected: CREATE

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 - this view for example

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 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 Message

Re: WHERE does not work on calculated view field

2011-04-23 Thread ars k
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(*) | +--+ |1 | +--+ 1 row

Re: WHERE does not work on calculated view field

2011-04-23 Thread Daniel Kraft
(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(*) FROM `myview2` WHERE `TypeName` LIKE

WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
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 COUNT(*) FROM `myview` WHERE `TypeName

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 getting started working with VIEWs and stored

Re: WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
`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 `TypeName

Re: WHERE does not work on calculated view field

2011-04-22 Thread Carsten Pedersen
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 COUNT(*) FROM `myview` WHERE

Re: WHERE does not work on calculated view field

2011-04-22 Thread Daniel Kraft
` 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 `TypeName` LIKE '%'; (I tried

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

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

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 For

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

2011-02-04 Thread Tompkins Neil
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' for the part of the statement that I've marked as *bold* and how I can over come this problem ? You have to add the users table to the subquery

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_id

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 neil.tompk...@googlemail.com 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

Help with Date in Where Clause

2011-01-31 Thread Phillip Baker
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 it but I keep getting an empty record set

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 just passing the date (without

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 sq...@dahl-stamnes.netwrote: Jørn

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

  1   2   3   4   5   6   7   8   9   10   >