|
Ok, got a tricky one here... If my data looks like this:
Table1
ID Date_Created 1 1/1/2009 2 1/3/2009 3 1/5/2009 4 1/10/2009 5 1/15/2009 6 1/16/2009
How do I get the records that are 2 days apart from each other? My end result set should be rows 1-3, ...
Started by Dakhath on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
Would this work?
select t1.id, t2.id from table1 t1 join table1 t2 on t2.date_created - t1.date_created <= 2
SELECT l.* FROM Table1 l INNER JOIN Table1 r ON DATEDIFF(d, l.Date_Created, r.Date_Created) = 2 AND r.Date_Created = (SELECT TOP 1 * FROM ... .
|
|
Hello,
Here's a simplified version of my scenario:
I have a table named Project that I reference via an 'id' field. I have a table named Photo that has a field named 'project_id' which I use to relate multiple photos to a single project. The Photo table...
Started by smoody on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
When you take it from there, all you are missing is a JOIN with your Projects table, which should be easy to do.... .
For the "last n items" problem in MySQL, take look here: How to select maximum 3 items per users in MySQL? (it's right in the top answer) .
|
|
What's the best way to write a LINQ query that inserts a record and then returns the primary key of that newly inserted record using C# ?
Started by Ebircsa on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
MyTable record = new MyTable(); record.Name = "James Curran"; db.MyTable.InsertOnSubmit(record); db.SubmitChanges(); Console.WriteLine("record inserted as ID....
The primary key value will be in that property after the SubmitChanges() .
|
Ask your Facebook Friends
|
Hi - we're trying to add an MX record to a Windows Server 2003 DNS server and getting the following error:
"A new record cannot be created. Node is a CNAME DNS record."
The domain is xyz.com. We create a new MX record and leave the "Host or child domain...
Started by Matt on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
MX and NS records The domain name used as the value of a NS resource record, or part of the value of a MX resource record must will be A records, however....
RFC 2181 forbids the use of a CNAME value in a MX record:
10.3.
|
|
I have abc.tv site which is configured on a.a.a.a IP and my mailing solution(test@abc.tv) which I want to configured on y.y.y.y IP address. Is is possible to have separate IPs fo my A record & MX record as below?
Domain name - abc.tv A Record - a.a.a....
Started by Chao on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
(thanks to Ludwig Weinzierl in comment below for pointing out this omission)
An ... .
A y.y.y.y
The host pointed to by the MX record must have an A or AAAA record and cannot be a CNAME record.
Mail.abc.tv.
A a.a.a.a MX 5 mail.abc.tv.
|
|
Hi,
I want to Copy a Row in SQL which has child records in 2 other tables. i want to duplicate them all if the master record duplicates.
for example if i say i want to copy master record with id 15 in to a new record. i want all its child records to be...
Started by Aneef on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
EDIT Changed to better match....
Which master record the current inserted record(s) were copied from, you'll need to track the primary key of the original record in a column in the master table (which I've labeled "copiedfromid" here.
|
|
Our systems cannot send e-mail to a company that has no MX record. There is an SMTP server running on their IP address and they are able to get e-mail from gmail. Is it normal for mail systems to try to connect to a SMTP server at the A record when there...
Started by joeforker on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at serverfault):
Normally yes, if no MX record exists, the A record should be used as a failsafe.
|
|
I have a files containing both duplicate and non-duplicate records.The file is already sorted by a key.I want to determine those records that are duplicate and records that are non-duplicate.If duplicate the record is move to a duplicate file and if non...
Started by gibboo on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If it's different from the previous record's key (or an initialized value), write the record to the "valid" file and remember the sort key to compare the next ....
For each record in the sorted file: read it and examine the sort key.
|
|
I wish to have someone point and resolve their domain to my web server to begin serving their pages.
Is it enough to have the person set only the NS1 and NS2 records to my name server, or must they also set the A Record as well?
Thanks
Started by Dr. DOT on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at serverfault):
However this may also have some administrative overhead sane thing for them to do is to only ... .
There are two distinct options:
They can continue hosting DNS for the domain and point the A record and you can configure the A record at will.
|
|
I have an oracle database populated with million records. I am trying to write a SQL query that returns the first 'N" sorted records ( say 100 records) from the database based on certain condition.
SELECT * FROM myTable Where SIZE > 2000 ORDER BY NAME...
Started by aJ on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
If you want to pick 100 random rows, sort those, and then return them, you'll have to formulate a query without the ORDER BY first, then limit that to 100 ... .
However, this won't do what you're asking.
Add this:
AND rownum <= 100
to your WHERE-clause.
|