Re: does mysql alert about all the duplicates?

2016-03-19 Thread Rebecca Love
Maybe this post will help you with your user/config question.

http://stackoverflow.com/questions/548541/insert-ignore-vs-insert-on-duplicate-key-update
 




> On Mar 16, 2016, at 7:46 AM, Reindl Harald  wrote:
> 
> 
> 
> Am 16.03.2016 um 13:38 schrieb lejeczek:
>> hi everybody
>> 
>> just another beginner's question.
>> if I insert into table and there are duplicate primary keys - does mysql
>> alert about all the duplicates or just the first one and then
>> exits/abandon the rest of the insert without any alerts for potential
>> further duplicates?
>> And is this a user/config controlled behavior?
> 
> only the first because it makes no sense when you attempt to make 100 
> inserts proceed the whole operation when in the second one a fatal error 
> happens
> 
> 
> 



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 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(f_tag_bottom_minor_axis,
>>>   IFNULL(f_tag_ch_x_bottom,
>>>IFNULL(f_tag_ch_y_bottom, NULL) as ftag,
>>>STDDEV(ch_x_top)
>>> FROM data_cst
>>> WHERE ftag = 'E-CD7'
>>> GROUP BY wafer_id, lot_id
>>> 
>>> But I can't use ftag in the where clause. I can't put it in a having
>>> clause, as that would exclude the already aggregated rows and I want
>>> to filter then before the aggregation. Anyone have any idea how I can
>>> do this?
>> 
>> 
>> why would you want to do that?
>> it would make the where clause not be able to use proper indexes
> 
> I do not know which of the 5 f_tag_* columns will be populated and I
> need to filter on the one that is populated.
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/mysql
> 


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql