Re: using alias in where clause

2016-01-29 Thread Larry Martell
On Fri, Jan 29, 2016 at 11:15 AM, shawn l.green wrote: > > > On 1/28/2016 6:30 PM, Larry Martell wrote: >> >> On Thu, Jan 28, 2016 at 5:45 PM, shawn l.green >> wrote: >>> >>> >>> >>> On 1/28/2016 3:32 PM, Larry Martell wrote: On Thu, Jan 28, 2016 at 2:13 PM, shawn l.green >>>

Re: using alias in where clause

2016-01-29 Thread shawn l.green
On 1/28/2016 6:30 PM, Larry Martell wrote: On Thu, Jan 28, 2016 at 5:45 PM, shawn l.green wrote: On 1/28/2016 3:32 PM, Larry Martell wrote: On Thu, Jan 28, 2016 at 2:13 PM, shawn l.green wrote: On 1/28/2016 1:14 PM, Larry Martell wrote: On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.nd

Re: using alias in where clause

2016-01-28 Thread Larry Martell
On Thu, Jan 28, 2016 at 5:45 PM, shawn l.green wrote: > > > On 1/28/2016 3:32 PM, Larry Martell wrote: >> >> On Thu, Jan 28, 2016 at 2:13 PM, shawn l.green >> wrote: >>> >>> >>> >>> On 1/28/2016 1:14 PM, Larry Martell wrote: On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.ndor wrote: >>

Re: using alias in where clause

2016-01-28 Thread shawn l.green
On 1/28/2016 3:32 PM, Larry Martell wrote: On Thu, Jan 28, 2016 at 2:13 PM, shawn l.green wrote: On 1/28/2016 1:14 PM, Larry Martell wrote: On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.ndor wrote: 2016/01/25 19:16 ... Larry Martell: SELECT IFNULL(f_tag_bottom, IFNULL

Re: using alias in where clause

2016-01-28 Thread Larry Martell
On Thu, Jan 28, 2016 at 2:13 PM, shawn l.green wrote: > > > On 1/28/2016 1:14 PM, Larry Martell wrote: >> >> On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.ndor wrote: >>> >>> 2016/01/25 19:16 ... Larry Martell: SELECT IFNULL(f_tag_bottom, IFNULL(f_tag_bottom_majo

Re: using alias in where clause

2016-01-28 Thread shawn l.green
On 1/28/2016 1:14 PM, Larry Martell wrote: On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.ndor wrote: 2016/01/25 19:16 ... Larry Martell: SELECT IFNULL(f_tag_bottom, IFNULL(f_tag_bottom_major_axis, IFNULL(f_tag_bottom_minor_axis, IFNULL(f_

Re: using alias in where clause

2016-01-28 Thread Larry Martell
On Tue, Jan 26, 2016 at 8:40 AM, Hal.sz S.ndor wrote: > 2016/01/25 19:16 ... Larry Martell: >> >> SELECT IFNULL(f_tag_bottom, >> IFNULL(f_tag_bottom_major_axis, >> IFNULL(f_tag_bottom_minor_axis, >>IFNULL(f_tag_ch_x_bottom, >>

Re: using alias in where clause

2016-01-26 Thread Hal.sz S.ndor
2016/01/25 19:16 ... Larry Martell: SELECT IFNULL(f_tag_bottom, IFNULL(f_tag_bottom_major_axis, IFNULL(f_tag_bottom_minor_axis, IFNULL(f_tag_ch_x_bottom, IFNULL(f_tag_ch_y_bottom, NULL) as ftag, STDDEV(c

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_tag_ch_y_bottom = > > 'E-CD7' > > UNIO

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 AS ftag FROM data_cst WHERE f_tag_ch_x_

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, Larry Martell wrote: >> >

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 F

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 cannot use an alias in a where clause, but I am trying

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 where clause my sql would look like this:

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