« first day (2653 days earlier)      last day (1665 days later) » 

3:32 AM
@Andrew I think I have worded the question incorrectly, what I meant was there can be more than those 4 types of values in that column but I only want cases where only those 4 are present for a particular address_id , there cannot be those 4 plus any other distinct type for attr_src for that particular address id
 
 
4 hours later…
7:19 AM
morning
 
7:52 AM
@RaphX - So you want those 4, but not any others
I would probably put a not exists clause in the where statement - and check no other options outside of the 4 existed.
 
 
2 hours later…
9:25 AM
WHERE NOT EXISTS(SELECT DISTINCT attr_src FROM gam.trans_address_attribute_detail WHERE attr_src NOT IN ('CUSTOMER', 'REGEX', 'POSTAL_AUTHORITY', 'DERIVED'))
like this?@Andrew
 
 
2 hours later…
11:11 AM
You don't need a distinct in the exists clause, since it is just checking if something exists or not
but yes, where not exists (select 1 from gam.trans_address_attribute_detail where attr_src not in ('x','y','z') and gam.trans_address_attribute_detail.some_ID_to_match_to_parent_query = parent_query.the_id_field)
it looks like the ID in question is address_id, and you need to alias the tables so its clear to the query which address_id = address_id - its a correlated sub-query in effect
 
 
2 hours later…
12:55 PM
hi everyone, i would like to know how to do a rollback when ever an exception ocurs ina MySQL script, can you guys help me ?
I wanted to use exceptions by catching them and then calling ROLLBACK, but i didn't find anything on the web
 
 
6 hours later…
6:42 PM
i just want to insert rows from a stored proc into a TABLE. (aka not a temp table)
literally every google query i do seems to lead specifically to a temp table. is there a reason for that?
cannot i not use a "real" table in this case instead?
 

« first day (2653 days earlier)      last day (1665 days later) »