Re: column aliases in query

2012-10-11 Thread hsv
2012/10/11 13:46 -0400, Mark Haney I know it's been a while since I wrote serious queries, but I'm sure I have done something like this before: SELECT SUBSTR(date,1,10) as vDate, event_id, events.mach_id, machine.factory_id FROM events JOIN machine ON events.mach_id = machine.mach_id W

RE: column aliases in query

2012-10-11 Thread Rick James
Some places allow aliases, some don't. Some (GROUP BY, ORDER BY) even allow ordinals. For performance, the optimal index would be INDEX(factory_id, date) and then do WHERE date >= "2012-10-11" AND date < "2012-10-11" + INTERVAL 1 DAY >

column aliases in query

2012-10-11 Thread Mark Haney
I know it's been a while since I wrote serious queries, but I'm sure I have done something like this before: SELECT SUBSTR(date,1,10) as vDate, event_id, events.mach_id, machine.factory_id FROM events JOIN machine ON events.mach_id = machine.mach_id WHERE machine.factory_id = "1" AND vDate = "

RE: Accessing Column Aliases In Other Columns?

2012-10-06 Thread Jan Steinman
Thanks, Rick! I had forgotten all about variables for some strange reason... The subselect isn't nearly as nice as variable, because I'd have to repeat it several times. On 5 Oct 12, at 20:19, mysql-digest-h...@lists.mysql.com wrote: > From: Rick James > > One way: > > SELECT @foo := this

RE: Accessing Column Aliases In Other Columns?

2012-10-03 Thread Rick James
Wednesday, October 03, 2012 4:09 PM > To: mysql@lists.mysql.com > Subject: Accessing Column Aliases In Other Columns? > > I would like to refer to calculated columns in other columns. I thought > a column alias would do it, but apparently they're only for > aggregation, like GRO

Accessing Column Aliases In Other Columns?

2012-10-03 Thread Jan Steinman
I would like to refer to calculated columns in other columns. I thought a column alias would do it, but apparently they're only for aggregation, like GROUP BY. Other than repeating the entire calculation, what techniques are available for accessing such a calculation? I'm calculating an electr

RE: Hungarian Notation [Was Re: Too many aliases]

2011-08-09 Thread Hal�sz S�ndor
2011/08/08 10:25 -0400, Jerry Schwartz I was a reluctant convert, and still don't use Hungarian notation consistently; but in something like MS Access, where you might want to associate a label with a field, things like "lblCompany" and "txtCompany" make a lot of sense. I forg

Re: Hungarian Notation [Was Re: Too many aliases]

2011-08-08 Thread Hal�sz S�ndor
2011/08/08 00:13 -0600, Mike Diehl Well, I can see this being useful in assembly language, or strongly-typed, non-OO languages. But I was asking specifically about SQL! We know from context that customers is a table and it makes no sense at all to prefix a type to it in order to

RE: Hungarian Notation [Was Re: Too many aliases]

2011-08-08 Thread Jerry Schwartz
bytesmiths.com; mysql@lists.mysql.com >Subject: RE: Hungarian Notation [Was Re: Too many aliases] > > >Jan- >the upside is you dont have to look up a variable to know what type it is: >zVariable is Null termed string >bVariable is boolean >nVariable is an Integer >fVariable is

Re: Hungarian Notation [Was Re: Too many aliases]

2011-08-07 Thread Mike Diehl
On Saturday 06 August 2011 10:58:43 am Jan Steinman wrote: > > From: Johnny Withers > > > > http://en.wikipedia.org/wiki/Hungarian_notation Well, I can see this being useful in assembly language, or strongly-typed, non-OO languages. But I was asking specifically about SQL! When will this EVER

Re: Hungarian Notation [Was Re: Too many aliases]

2011-08-07 Thread David Lerer
y Cc: mysql@lists.mysql.com Sent: Sun Aug 07 19:03:43 2011 Subject: Re: Hungarian Notation [Was Re: Too many aliases] I despise this sort of notation, and have instead adopted what have cheerfully named Hungarian Suffix notation, the reason being Signal-To-Noise ratio. Instead of prefacing everything

Re: Hungarian Notation [Was Re: Too many aliases]

2011-08-07 Thread Arthur Fuller
I despise this sort of notation, and have instead adopted what have cheerfully named Hungarian Suffix notation, the reason being Signal-To-Noise ratio. Instead of prefacing everything with some form of prefix, just do the opposite: Customer_tbl Customer_Dead_boo Customer_DOB_date Customer_qs (that

RE: Hungarian Notation [Was Re: Too many aliases]

2011-08-06 Thread Martin Gainty
..Shawshank Redemption > Subject: Hungarian Notation [Was Re: Too many aliases] > From: j...@bytesmiths.com > Date: Sat, 6 Aug 2011 09:58:43 -0700 > To: mysql@lists.mysql.com > > > From: Johnny Withers > > > > http://en.wikipedia.org/wiki/Hungarian_notation > >

Re: Too many aliases

2011-08-06 Thread Johnny Withers
It's simple... ttwwadi is the only reason I assume. Sent from my iPad On Aug 5, 2011, at 2:39 PM, (Hal�sz S�ndor) h...@tbbs.net wrote: > 2011/08/04 10:21 -0500, Johnny Withers > http://en.wikipedia.org/wiki/Hungarian_notation > > > On Thu, Aug 4, 2011 at 9:41 AM, Mike Diehl

Hungarian Notation [Was Re: Too many aliases]

2011-08-06 Thread Jan Steinman
> From: Johnny Withers > > http://en.wikipedia.org/wiki/Hungarian_notation "The original Hungarian notation... was invented by Charles Simonyi... who later became Chief Architect at Microsoft." Ugh. That explains a lot! The only time I let types intrude on names is with booleans, which I try

Re: Too many aliases

2011-08-06 Thread Hal�sz S�ndor
2011/08/04 10:21 -0500, Johnny Withers http://en.wikipedia.org/wiki/Hungarian_notation On Thu, Aug 4, 2011 at 9:41 AM, Mike Diehl wrote > Well, while we're on the subject of SQL style, can anyone tell me why I'm > always seeing people prefixing the name of a table with something like >

Re: Too many aliases

2011-08-04 Thread Johnny Withers
; Sent: Thursday, August 04, 2011 8:26 AM > > To: r...@grib.nl > > Cc: mysql@lists.mysql.com > > Subject: Re: Too many aliases > > > > >>>> 2011/08/03 12:46 +0200, Rik Wasmus >>>> > > > > But the > > main thing is it helps

Re: Too many aliases

2011-08-04 Thread Mike Diehl
d. > > -Original Message- > From: h...@tbbs.net [mailto:h...@tbbs.net] > Sent: Thursday, August 04, 2011 8:26 AM > To: r...@grib.nl > Cc: mysql@lists.mysql.com > Subject: Re: Too many aliases > > >>>> 2011/08/03 12:46 +0200, Rik Wasmus >>>>

RE: Too many aliases

2011-08-04 Thread Jerry Schwartz
>-Original Message- >From: David Lerer [mailto:dle...@us.univision.com] >Sent: Wednesday, August 03, 2011 10:25 AM >To: mysql@lists.mysql.com >Subject: RE: Too many aliases > >I rarely use aliases (unless rarely required in self-join queries). >Yes, the column name

RE: Too many aliases

2011-08-04 Thread David Lerer
...@grib.nl Cc: mysql@lists.mysql.com Subject: Re: Too many aliases >>>> 2011/08/03 12:46 +0200, Rik Wasmus >>>> But the main thing is it helps to distinguish tables in joins having the same table more then once (and of course results from subqueries etc.): SELECT first.* FROM t

Re: Too many aliases

2011-08-04 Thread Hal�sz S�ndor
d ONfirst.some_id = second.some_id AND first.id != second.id WHERE second.id IS NULL <<<<<<<< Well, yes, here it is needful. But it seems to me from most of the examples that people here post, that they have the idea that it is the style always to use one-letter aliases, whe

RE: Too many aliases

2011-08-03 Thread shawn wilson
On Aug 3, 2011 9:24 AM, "David Lerer" wrote: > > I rarely use aliases (unless rarely required in self-join queries). > When I have that option, I create unique columns by prefixing every > table (and its objects) with a number. > Something like: > Create table T1234_Em

RE: Too many aliases

2011-08-03 Thread David Lerer
I rarely use aliases (unless rarely required in self-join queries). When I have that option, I create unique columns by prefixing every table (and its objects) with a number. Something like: Create table T1234_Employee (C1234_Employee_id number(5), C1234_employee_status char(1)...) Index

Re: Too many aliases

2011-08-03 Thread Rik Wasmus
> 2011/08/02 12:11 +0530, Adarsh Sharma > > select p.* from table A p, B q where p.id=q.id > > or > > select p.* from table B q , A p where q.id=p.id > > Why do people constantly change table names for queries, although, as here, > it gain them nothing? It often makes for less

Too many aliases

2011-08-02 Thread Hal�sz S�ndor
2011/08/02 12:11 +0530, Adarsh Sharma select p.* from table A p, B q where p.id=q.id or select p.* from table B q , A p where q.id=p.id Why do people constantly change table names for queries, although, as here, it gain them nothing? It often makes for less clarity (for which

Re: multiple aliases

2010-09-27 Thread Shawn Green (MySQL)
On 9/27/2010 9:10 AM, Ramsey, Robert L wrote: I have a query with three subselects, all referencing the same table. I'd like to be able to combine them into one with aliases. Here's what I have now: select letter_codename, (select greek from letter_otherlanguages where letter =&#x

RE: multiple aliases

2010-09-27 Thread Travis Ard
nday, September 27, 2010 7:10 AM To: [MySQL] Subject: multiple aliases I have a query with three subselects, all referencing the same table. I'd like to be able to combine them into one with aliases. Here's what I have now: select letter_codename, (select greek from letter_otherlangua

multiple aliases

2010-09-27 Thread Ramsey, Robert L
I have a query with three subselects, all referencing the same table. I'd like to be able to combine them into one with aliases. Here's what I have now: select letter_codename, (select greek from letter_otherlanguages where letter ='A') as greek, (select french from letter_

RE: Update Join with Aliases

2007-11-30 Thread Jerry Schwartz
Subject: Update Join with Aliases > > Hello. > > I am having a time trying to get this to work. I hope someone can help > me wit the syntax! > > Here is the original query: > > UPDATE ambien_nev.Sections > INNER JOIN ambien_nev.Sections ON natural_db.Sections.s

Update Join with Aliases

2007-11-30 Thread Elissa Joan
message: Not unique table/alias: 'Sections' So I tried aliases: UPDATE ambien_nev.Sections as SectionsSp INNER JOIN SectionsSp ON natural_db.Sections.section_id = SectionsSp.section_id SET SectionsSp.feature1 = natural_db.Sections.feature1, SectionsSp.feature2 = natural_db.Section

RE: Need ideas on handling aliases and a.k.a.s

2007-10-22 Thread Jerry Schwartz
CTED] > Sent: Friday, October 19, 2007 9:04 PM > To: mysql@lists.mysql.com > Subject: Need ideas on handling aliases and a.k.a.s > > I'm trying to wrap my head around dealing with people in a table that > have multiple names or akas. > > I run an entertainment news site and

Re: Need ideas on handling aliases and a.k.a.s

2007-10-19 Thread mysql
e Last field and remember to always use Longoria Parker when I input new info, but what happens if she gets divorced? Just wondering how some of you have handled akas/aliases/divorces for things like customer databases. How do you ensure that a name change doesn't actually cause a brand new re

Need ideas on handling aliases and a.k.a.s

2007-10-19 Thread Ian M. Evans
er to always use Longoria Parker when I input new info, but what happens if she gets divorced? Just wondering how some of you have handled akas/aliases/divorces for things like customer databases. How do you ensure that a name change doesn't actually cause a brand new record for the person if

aliases for types

2007-08-11 Thread Olav Mørkrid
hello is it possible to make aliases for types, so that for instance: "uint" means "int unsigned not null default 0" it makes table definitions unreadable having to write those long definitions all the time. thanks! -- MySQL General Mailing List For list archives: ht

RE: Does Update allow for aliases?

2007-01-17 Thread Jonathan Langevin
I concede to the MySQL engineer :-) -Original Message- From: Shawn Green [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 3:30 PM To: Jonathan Langevin Cc: Chris White; Richard Reina; mysql@lists.mysql.com Subject: Re: Does Update allow for aliases? Hi all, Multi-table

Re: Multiple table updates (Was: Does Update allow for aliases)

2007-01-11 Thread Brent Baisley
HERE y.id IS NULL Or the opposite with a multi-table update: UPDATE x,y SET x.YitemsExist="Y", y.XitemsExist="Y" WHERE x.id=y.id - Original Message - From: "Chris White" <[EMAIL PROTECTED]> To: Sent: Wednesday, January 10, 2007 12:55 PM Subject: Multiple tabl

Re: Multiple table updates (Was: Does Update allow for aliases)

2007-01-11 Thread Brent Baisley
The key part of the documentation for me was: - Original Message - From: "Chris White" <[EMAIL PROTECTED]> To: Sent: Wednesday, January 10, 2007 12:55 PM Subject: Multiple table updates (Was: Does Update allow for aliases) Reading the noted previous thread, I w

Re: Does Update allow for aliases?

2007-01-10 Thread ViSolve DB Team
es Update allow for aliases? I am trying to update from one table to another but I get a syntax error when I try: UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID; If update does not support aliases, is there another way to do this query? I am usin V3.23.54.

Re: Does Update allow for aliases?

2007-01-10 Thread Shawn Green
Hi all, Multi-table updates are not possible for versions older than 4.0.4. (http://dev.mysql.com/doc/refman/4.1/en/update.html) so the operation is not possible with your current version. To be complete, though, each of you missed the second syntax error in his statement Jonathan Langevin

RE: Does Update allow for aliases?

2007-01-10 Thread Jonathan Langevin
[mailto:[EMAIL PROTECTED] Sent: Wednesday, January 10, 2007 12:10 PM To: Richard Reina Cc: mysql@lists.mysql.com Subject: Re: Does Update allow for aliases? Richard Reina wrote: > I am trying to update from one table to another but I get a syntax error when I try: > > UPD

Multiple table updates (Was: Does Update allow for aliases)

2007-01-10 Thread Chris White
Reading the noted previous thread, I was curious as to updating multiple tables. I read the MySQL docs, which mentions that you can do it: Multiple-table syntax: UPDATE [LOW_PRIORITY] [IGNORE] /|table_references|/ SET /|col_name1|/=/|expr1|/ [, /|col_name2|/=/|expr2|/ ...] [WHERE /|where

Re: Does Update allow for aliases?

2007-01-10 Thread Nils Meyer
Hi Richard, Richard Reina wrote: I am trying to update from one table to another but I get a syntax error when I try: UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID; If update does not support aliases, is there another way to do this query? I am usin

Re: Does Update allow for aliases?

2007-01-10 Thread Chris White
Richard Reina wrote: I am trying to update from one table to another but I get a syntax error when I try: UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID; First off, it'd be best if possible (I know some cases prevent it) to upgrade your server. The

Does Update allow for aliases?

2007-01-10 Thread Richard Reina
I am trying to update from one table to another but I get a syntax error when I try: UPDATE from maindb.orders o, altdb.orders ao SET o.price=ao.price WHERE o.ID=a.ID; If update does not support aliases, is there another way to do this query? I am usin V3.23.54. Any help would be

Re: Can't reference column aliases

2005-11-07 Thread SGreen
Jochem van Dieten <[EMAIL PROTECTED]> wrote on 11/07/2005 03:32:25 PM: > On 11/7/05, mos wrote: > > Why isn't there a way to reference column aliases in the columns list or > > where clause? > > Because the SQL standad says so. See chapter 7 of ISO/IEC 9075-2:20

Re: Can't reference column aliases

2005-11-07 Thread Jochem van Dieten
On 11/7/05, mos wrote: > Why isn't there a way to reference column aliases in the columns list or > where clause? Because the SQL standad says so. See chapter 7 of ISO/IEC 9075-2:2003. > select if(score<50,-5,0) failing_score, if(score>50, 1, 0) passing_score, &g

Re: Can't reference column aliases

2005-11-07 Thread Scott Noyes
> Why isn't there a way to reference column aliases in the columns list or > where clause? http://dev.mysql.com/doc/refman/5.0/en/problems-with-alias.html That's why. -- Scott Noyes [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysq

Can't reference column aliases

2005-11-07 Thread mos
Why isn't there a way to reference column aliases in the columns list or where clause? Example: select if(score<50,-5,0) failing_score, if(score>50, 1, 0) passing_score, attendance/totaldays Percent_Attendance , failing_score/passing_score*percent_attendance from schoolwork (

Re: Console aliases

2005-03-04 Thread jacob martinson
Does anyone know if there are any 3rd party shells that can connect to a mysql server that support aliases, or have any features that can make working from the console faster? Thanks! -Jacob On Fri, 4 Mar 2005 11:59:56 -0600, jacob martinson <[EMAIL PROTECTED]> wrote: > Is it possible

Re: Console aliases

2005-03-04 Thread Gleb Paharenko
Hello. No. There are only short forms of each command. See: http://dev.mysql.com/doc/mysql/en/mysql-commands.html jacob martinson <[EMAIL PROTECTED]> wrote: > Is it possible to setup aliases in the mysql console to cut down on > typing, i.e. instead of having to ty

Console aliases

2005-03-04 Thread jacob martinson
Is it possible to setup aliases in the mysql console to cut down on typing, i.e. instead of having to type out "show tables" I can just type "\dt" as in postgresql? Thanks, Jacob -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: nested aliases in select

2005-02-26 Thread mos
At 04:11 PM 2/26/2005, David Smithson wrote: Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned is:

Re: nested aliases in select

2005-02-26 Thread Roger Baklund
David Smithson wrote: Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned is: ERROR 1064: You have a

nested aliases in select

2005-02-26 Thread David Smithson
Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned is: ERROR 1064: You have an error in your SQL

nested aliases in select

2005-02-26 Thread David Smithson
Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The table has: contact_ident contact_firstname contact_lastname

Re: Text field how to handle aliases

2004-10-19 Thread Eldo Skaria
Hi, For this only RDBMS came into being. You keep your master data in a table with relevent descriptions, codify the item. Use the code in other location. In qa web page always search against/show the full desc of what others require. Add a category like school/university/pre-matric etc. this coul

Re: Text field how to handle aliases

2004-10-19 Thread SGreen
Don't think "file" think "table"! ;-) CREATE TABLE universitysynonyms ( ID int auto_increment primary key, synonym varchar(40) not null, university_id int not null, UNIQUE(Synonym, university_id) ) Each time you run into something you don't have in your "universit

Text field how to handle aliases

2004-10-19 Thread Lewick, Taylor
I need help on the best way to handle a field that could have many different ways of naming something. For instance, school name Let's take Saint Joseph's University This could be Saint Joseph's Univeristy, U. of St. Joe, SJU, Univ. St. Joe, etc... In this case, I don't think I can always get w

Re: Table name aliases in FULLTEXT and table locking

2004-10-18 Thread Sergei Golubchik
Hi! On Oct 05, Ville Mattila wrote: > Hi there, > > I have noticed a few things that cause problems when using table aliases > (SELECT ... FROM table1 t1, table2 t2): > > 1) Fulltext index queries don't work. I tried to complete a following query: > > a) > SE

Table name aliases in FULLTEXT and table locking

2004-10-05 Thread Ville Mattila
Hi there, I have noticed a few things that cause problems when using table aliases (SELECT ... FROM table1 t1, table2 t2): 1) Fulltext index queries don't work. I tried to complete a following query: a) SELECT p.*, c.name AS categoryname FROM products p, categories c WHERE MATCH(p

Re: MULTI-DELETE BUG when used WITH TABLE ALIASES (ver. mysql-4.1.3-beta-standard)

2004-07-19 Thread Garth Webb
This is expected behavior for MySQL post version 4.1. Check out: http://dev.mysql.com/doc/mysql/en/DELETE.html particularly the 'Note:' section just before the user comments. If you use table aliases you must use those aliases to refer to the tables you want to delete, not the t

MULTI-DELETE BUG when used WITH TABLE ALIASES (ver. mysql-4.1.3-beta-standard)

2004-07-19 Thread Asim Thakker
>Description: Multi-delete stops working in all forms when used along with table aliases, it gives an error saying ERROR 1109 (42S02): Unknown table 'test_base' in MULTI DELETE Which definately is NOT the case. After trying all kinds of combinations I reli

Re: Aliases and bookmarks

2004-03-15 Thread Egor Egorov
Scott Haneda <[EMAIL PROTECTED]> wrote: > There are some things I do in mysql often, is there some way to alias or > otherwise bookmark a a sql statement for simple rapid use in the future? You can put SQL statements to the file and then execute them from the file. -- For technical support con

Aliases and bookmarks

2004-03-14 Thread Scott Haneda
There are some things I do in mysql often, is there some way to alias or otherwise bookmark a a sql statement for simple rapid use in the future? -- - Scott HanedaTel: 415.898.2602 http://www.newgeo.com

RE: Issues with count(), aliases, and LEFT JOINS

2003-12-17 Thread Brandon Ewing
> -Original Message- > From: Chris [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 17, 2003 8:12 AM > To: [EMAIL PROTECTED] > Subject: RE: Issues with count(), aliases, and LEFT JOINS > > Try changing it to this: > > ... > -> COUNT(DISTI

RE: Issues with count(), aliases, and LEFT JOINS

2003-12-17 Thread Chris
Original Message- From: Brandon Ewing [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 17, 2003 1:59 AM To: [EMAIL PROTECTED] Subject: RE: Issues with count(), aliases, and LEFT JOINS > -Original Message- > From: Brandon Ewing [mailto:[EMAIL PROTECTED] > Sent: Monday, Dec

RE: Issues with count(), aliases, and LEFT JOINS

2003-12-17 Thread Brandon Ewing
> -Original Message- > From: Brandon Ewing [mailto:[EMAIL PROTECTED] > Sent: Monday, December 15, 2003 2:28 AM > To: [EMAIL PROTECTED] > Subject: Issues with count(), aliases, and LEFT JOINS > > Greetings, > > This is driving me crazy. > > I'm ru

Issues with count(), aliases, and LEFT JOINS

2003-12-15 Thread Brandon Ewing
Greetings, This is driving me crazy. I'm running MySQL 4.0.15-standard. I've got a db that tracks switches, servers they connect to, and connections between switches. Schema for server: +--+ --+ | Field|

Aliases

2003-12-04 Thread Chris Boget
If you can do this: SELECT table_a_alias.col_name FROM table_a table_a_alias; Why can't you do this: SELECT 1 AS A, A + 1 AS B, B + 1 AS C; Why can't you use column aliases later in the select? When you can use table aliases even before they are defined. thnx, Chris

RE: Aliases

2003-11-10 Thread Erik Osterman
lto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 7:34 PM To: [EMAIL PROTECTED] Subject: Re: Aliases what if we use the function at the right side of the equation? such as select anything from table1, table2 where table1.id=left(table2.id,somenumber) having both id in table were indexed dont yo

Re: Aliases

2003-11-10 Thread Leo
- From: Erik Osterman To: [EMAIL PROTECTED] Sent: Wednesday, November 12, 2003 3:17 AM Subject: RE: Aliases > From: Matt W [mailto:[EMAIL PROTECTED] > Sent: Monday, November 10, 2003 5:47 PM > To: Erik Osterman; [EMAIL PROTECTED] > No, Roger's method can't use

RE: Aliases

2003-11-10 Thread Erik Osterman
> From: Matt W [mailto:[EMAIL PROTECTED] > Sent: Monday, November 10, 2003 5:47 PM > To: Erik Osterman; [EMAIL PROTECTED] > No, Roger's method can't use an index. :-) But yes, using WHERE is > better than HAVING. Ah... right indeed. In this case it wouldn't work. My mistake... :) > To get the

Re: Aliases

2003-11-10 Thread Matt W
#x27;; And I would guess that LIKE will be faster than the LEFT() function even if there is no index. Matt - Original Message - From: "Erik Osterman" Sent: Tuesday, November 11, 2003 6:39 AM Subject: RE: Aliases However, you can use HAVING. HAVING is post-processed, in a br

RE: Aliases

2003-11-10 Thread Erik Osterman
Regards, Erik Osterman -Original Message- From: Roger Baklund [mailto:[EMAIL PROTECTED] Sent: Sunday, November 09, 2003 6:59 AM To: [EMAIL PROTECTED] Cc: David Katz Subject: Re: Aliases * David Katz > I am trying to do a select statement where I am using one of the > aliases in the

Re: Aliases

2003-11-09 Thread Roger Baklund
* David Katz > I am trying to do a select statement where I am using one of the > aliases in the where clause. I keep getting an error that the field > does not exist. >From the manual: "Note that standard SQL doesn't allow you to refer to an alias in a WHERE clause. Th

Aliases

2003-11-09 Thread David Katz
I am trying to do a select statement where I am using one of the aliases in the where clause. I keep getting an error that the field does not exist. example: Select invno, invdate, invamt, left(invdate,2) as month from salesfile where month = '01' MySql keeps telling me that mont

HELP: Problem with MySQL column aliases

2003-03-10 Thread Timothy Miller
I hope I've subscribed to the right list. I am using version 3.23.41 of MySQL, and I'm having a problem getting correct (expected?) behavior with column aliases. I have a database A which has, among other things, an id field, something like this: CREATE TABLE a { somedata VARCHAR(10

Re: Problem JOINing with Aliases

2002-10-31 Thread Bruce Hodo
No, I hadn't. So I did. IT WORKED! Thank you very much! Roger Baklund wrote: * [EMAIL PROTECTED] [...] In other words, any pix that has a bigpix defined is ok. But on any pix that does not have a bigpix defined, I "loose" the filename info from pix. And I don't understand why! Here is the

Re: Problem JOINing with Aliases

2002-10-31 Thread Roger Baklund
* [EMAIL PROTECTED] [...] > In other words, any pix that has a bigpix defined is ok. But on any > pix that does not have a bigpix defined, I "loose" the filename info > from pix. > > And I don't understand why! > > Here is the second query: > > select > pix_section.code,pix.filename,pix.id,pix_use.

Problem JOINing with Aliases

2002-10-30 Thread Bruce Hodo
I have a database defined with the following tables: CREATE TABLE pix ( id int(11) NOT NULL auto_increment, propertyid int(11) NOT NULL default '0', filename varchar(25) default NULL, caption varchar(50) default NULL, width smallint(4) unsigned NOT NULL default '0', height smallint(4)

Problem with length of String aliases with 4.0.0

2002-02-12 Thread Jostein Solstad
Hello. I was adviced to write to you about this from an experiensed mySQL user, as this might be a bug in 4.0.0 Im trying to do this: select col1,col2,col3,'text' as name from tabel where blahblah now, this would add 'text' to all rows in the result, and that works just fine but, if i try with '

Problem with length of String aliases with 4.0.0

2002-02-08 Thread Jostein Solstad
Hello. I was adviced to write to you about this from an experiensed mySQL user, as this might be a bug in 4.0.0 Im trying to do this: select col1,col2,col3,'text' as name from tabel where blahblah now, this would add 'text' to all rows in the result, and that works just fine but, if i try with '

Aliases, Fully Qualified Column Names

2001-08-19 Thread Hans Zaunere
Is there a way to have MySQL label columns returned from a select query with the complete column name, in table.column format? So if a column name is id, which is in the main table, can MySQL return main.id instead of just id. Sure I could alias each column, but if there is 30 columns, that's