How to exclude no name from MYSQL Export?

How to exclude no name from Export?



As an example I have some old sales that were made before I forced all customers to register. Now when I export my emails to my newsletter program all is well except I have a small number of emails without names and I do not want to send emails to those addresses.



A custom SQL statement added to my import function should work but i do not know how to word it.



WHERE “datasource” <>



Is as far as I have gotten - I am a database novice.



Any ideas?



Thank you!

What table are you exporting?



You should be able to use something like:


SELECT * FROM tablename WHERE namefield != ""



This would exclude any record where the name field is blank.



Bob

[quote name=‘jobosales’]What table are you exporting?



You should be able to use something like:


SELECT * FROM tablename WHERE namefield != ""



This would exclude any record where the name field is blank.



Bob[/QUOTE]



Bob,





Source table name: cscart_orders & also cscart_users

Source field for subscriber’s email: email

Source field for subscriber’s name: firstname

Source field for subscriber’s last name: lastname



2 tables:



cscart_orders



cscart_users



So something like this:



FROM cscart_orders WHERE email != "```php



What should “Code” be? and how do I do 2 tables?

It sounds like you have an email addy but no name. If so, you could do something like this:

SELECT * FROM cscart_orders WHERE firstname != '' AND lastname != ''



You are saying you want to return every record where both the firstname and lastname are null (single quotes with no space between). If you don’t need the whole record returned, you can replace the * with a list of fields you want returned.


SELECT firstname, lastname, email FROM cscart_orders WHERE firstname != '' AND lastname != ''



Bob

where firstname<>‘’



worked well it is interesting learning about databases.



Thanks again.



I am step by step geteting my user list in good shape.



Next up is figuring out what to do with customers who open two accounts with 2 email addresses.



If the email addresses are the same no problem as duplicates are filtered out.



Even if I set up a system to only export the most current account what if two John Smiths have an account and they are different people/ I don’t want to drop a good name but i may have to.