|
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.
|
|
Say you own a abcd.com and you only want to use it to send and receive email via bob@abcd.com . You don't want to provide any kind of website.
Can you set up the DNS records to include an "MX" record and no "A" record?
Is this enough for sending and receiving...
Started by frou on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at serverfault):
Strictly speaking, mail.otherdomain.com should....
As long as the name.
For example: example.com can have a MX record pointing at mail.otherdomain.com .
As long as the system pointed at by the MX record has an A record itself, then yes.
|
|
Please see data given below
I want to keep one set of records and want to delete another duplicate set of records. You can see ForeignKey are same just Primary Key is different.
Need to keep 2 records having lowest primary key among the set of 4 records...
Started by Muhammad Kashif Nadeem on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Delete from Table mytable t1 where exists (select 1 from mytable t2 where t2.PrimaryKey < t1.PrimaryKey and t2.ForeignKey = t1.ForeignKey and t2.AnotherForeignKey = t1.AnotherForeignKey)
Using CTE functionality from SQL Server 2005, you can delete... .
|