sql select statement

Cancelado

Descripción

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

ID de proyecto: #12744810

77 los freelancers están ofertando un promedio de £113 para este trabajo.

kchg

Hello, sir. My ranking is TOP 5TH in freelancer.com as you can see my profile: (https://www.freelancer.com/u/kchg.html). I'd like to discuss with you in detail. Kind Regards

£750 GBP en 3 días
(162 comentarios)
8.5
£20 GBP en 1 día
(61 comentarios)
6.5
£30 GBP en 1 día
(111 comentarios)
6.2
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 http://e-xpedition.ru/ http://www.diamondbeat.com http:// Más

£555 GBP en 10 días
(2 comentarios)
5.5
vladang

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

£18 GBP en 1 día
(83 comentarios)
5.7
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
(30 comentarios)
5.5
£10 GBP en 1 día
(71 comentarios)
5.6
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
(26 comentarios)
5.6
£23 GBP en 1 día
(108 comentarios)
5.8
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
£23 GBP en 0 días
(10 comentarios)
5.1
sat12

Hi, I am joomla, virtuemart expert having 5 years of experience. Recently i completed these projects http://www.ticotogo.com http://pandanusmooloolaba.com.au http://www.mscertkit.nl Please award me the project.

£23 GBP en 1 día
(98 comentarios)
5.4
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
(5 comentarios)
4.5
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
(8 comentarios)
4.5
£260 GBP en 10 días
(8 comentarios)
4.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
(22 comentarios)
4.1
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
(6 comentarios)
4.1
brendanmullan90

Hi there, my name is Brendan and i am an expert in Web Development holding over 7 years experience in the field.I specialise in building high quality websites, website scripts, responsive templates and building sites w Más

£13 GBP en 0 días
(9 comentarios)
4.1
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=c.rgid) union select g.rgid, g.name, "old comments" as state from Más

£18 GBP en 0 días
(17 comentarios)
4.3
junaidgulzar0786

I read through the job details extremely carefully and I am absolutely sure that I can do the project very well.

£250 GBP en 0 días
(9 comentarios)
3.8