Cancelado

sql select statement

Hi, I need a small SQL statement written. I know it's pretty simple via sub query or something, but I can't get my head around it.

The general idea is that I will mail people who have not been mailed before, or it has been over 30 days. The comms routine already has it's own resending process, hence, we care about is_complete.

You will not have access to my database. I have two tables:

ghosts:

rgid = int

... etc

comms:

rgid = int

is_complete (0/1)

updated (UTC integer)

... etc

Rules:

1. You can have more than one comms per ghost.

2. There may not be any comms for a ghost.

I need to return a distinct list of ghosts (the whole row, not just the rgid) where:

1. no comms exists at all yet OR

2. comms exist, but all of them are is_complete=1 and the most recent comms is updated over 30 days ago.

Habilidades: MySQL, SQL

Ver más: programmer fixed pay, fixed pay job usa, additional fixed pay, php coder pay happy, wcf application insert database sql 2008 vbnet query, sub account query, sql database size query, oracle sql format currency query, sql server 2008 query latitude longitude radius, oracle sql order date query example, sql microsoft project query, oracle sql statement select employees database work projects, sql add decimal query oracle, sql parentchild tree query, sql server remote query mysql, sql menu tree query, sql tree menu query, sql parent child query xml, sql parent child query, converting access 2000 sql, microsoft sql express csv import, configura microsoft sql per primavera, sample excel sqlrequest access db2 sql, converting access database sql server 2008, conversion access 2000 sql server 2005

Información del empleador:
( 5 comentarios ) Ruislip, United Kingdom

ID de proyecto: #12744810

75 los freelancers están ofertando un promedio de £116 para este trabajo.

kchg

Hello, sir. My ranking is TOP 5TH in [url removed, login to view] as you can see my profile: ([url removed, login to view]). I'd like to discuss with you in detail. Kind Regards

£750 GBP en 3 días
(181 comentarios)
8.8
£20 GBP en 1 día
(61 comentarios)
6.5
£30 GBP en 1 día
(121 comentarios)
6.5
£23 GBP en 1 día
(130 comentarios)
6.0
vladang

Hello sir.... I am interested. Please share more details.

£18 GBP en 1 día
(87 comentarios)
5.9
svyatozar

Greetings! Please consider my bid. I can help you with mysql select. Let's chat right now. Best regards, -Alexandre Kharlamov

£20 GBP en 1 día
(31 comentarios)
5.6
solafort

Hi. I am a skillful and talented Web developer. I have more than 8 years experience with Web site development, so no problem for MySQL/SQL. - Frontend [url removed, login to view] [url removed, login to view] http:// Más

£555 GBP en 10 días
(3 comentarios)
5.7
alexgospodarets

Hi! I have 10+ years of web developing experience, I can promise quality and responsibility. We can start immediately. The price would be less if i have access or tables with some demo data.

£100 GBP en 1 día
(36 comentarios)
5.9
£10 GBP en 1 día
(90 comentarios)
5.9
vrickson

Hi Let me know how can i help you. I know how to do it. Please specify key field etc and what is the object that you want to achieve from this script. Please revert Thanks Vijay

£23 GBP en 1 día
(3 comentarios)
5.6
sat12

Hi, I am joomla, virtuemart expert having 5 years of experience. Recently i completed these projects [url removed, login to view] [url removed, login to view] [url removed, login to view] Please award me the project.

£23 GBP en 1 día
(115 comentarios)
5.6
mushrraf

Hello! Hopefully you are fine! Please tell me what is your statement requirement and I would do it for you! Regards Mushrraf Baig Ashraf

£18 GBP en 1 día
(49 comentarios)
5.2
AshleyCASTILLO

Hello, Greetings ! I am writing you regarding the job description and you would be happy to know that I hold all the skills which are required to complete the project as I have 6+ years of experience on core Php, Más

£23 GBP en 1 día
(6 comentarios)
4.9
£260 GBP en 10 días
(12 comentarios)
4.7
jaylancer43

Hello Sir, I am an Expert Techno-Functional Analyst having vast experience in lots of arenas of IT industry including SQL. I am an Engineering Graduate with an MBA degree. If you see I am among niche bidders who hav Más

£250 GBP en 2 días
(9 comentarios)
4.6
phiona06

-- Hi! I think it will be like this: select g.*, "no comments" as state from ghosts g where not exists (select * from comms c where g.rgid=[url removed, login to view]) union select [url removed, login to view], [url removed, login to view], "old comments" as state from Más

£18 GBP en 0 días
(26 comentarios)
4.7
£23 GBP en 0 días
(12 comentarios)
5.4
davedcb

Hello, I am interested in your project. I am a software engineer with experience in SQL. Thank you, Best regards, David

£11 GBP en 1 día
(23 comentarios)
4.1
avi2105

Hi, Hope you doing good? I am experienced PHP developer having expertise in e-commerce domain using Zen Cart, Wordpress, Codeigniter, OsCommerce, CreLoaded, MVC framework, Prestashop, Opencart, HTML5, Bootstrap, Más

£13 GBP en 0 días
(11 comentarios)
4.2
nurakantech

I can be of help if you need it. I am good with sql and php. Let me know what you need. Best Regards

£555 GBP en 10 días
(8 comentarios)
4.3