|
select top 1 * from where id='1' order by Date asc
Thanks and Regards
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
Ya its working,
But order by date desc only getting correct output..,
Thanks lot for ur reply...,
Keep in touch,
Magi
|
|
|
|
|
Select MAX(Date)
From YourTable
Group by Id
maybe this can help you
|
|
|
|
|
Hi all,
How to cluster tables in sql 2005
|
|
|
|
|
Please First Refer to Books for such stuff, if you find anything difficult to understand then CODEPROJECT welcomes you.
Thanks & Regards
Navneet Hegde
Nashik
Develop2Program & Program2Develop
|
|
|
|
|
I posted my message since i did not find any relevant info from any books or else i would not ve posted
|
|
|
|
|
By clustering do you mean relationships?
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Hiiii... all....
I have a table called "orders" ..
In that table ive some orderslist for particular dates ... then r not in certain order ...
now i want to count the records stored in particular date , and i want to display only the "date and total orders ( count ) done in that particular date ...
..............
like ,
Date TotalOrders(Count)
1/5/2007 50
2/5/2007 45
3/5/2007 80
LIke this ... plz help me
Thanks in adv
Naresh
|
|
|
|
|
select OrderDate, count(OrderID)
from tblOrder
where OrderDate between '2007-01-01' and '2007-03-31'
group by OrderDate
----------------------------------------------
Damian - still with no useful signature...
|
|
|
|
|
Hi Thanks Alot but
iam not getting result exactly ....
I think the problem is with the time .... iam having datetime not only date ...
I tried like this
select orcvddatetime, count(OurORef) from ordermain group by orcvddatetime
Now am getting the count but its depends on time, i need the result based on date ,
now
my query is
---------
select orcvddatetime, count(OurORef) from ordermain where orcvddatetime between '2007-03-12 10:07:00' and '2007-02-13 06:07:00' group by orcvddatetime
---------
but iam getting empty data
it is showing like this >>>>
orcvddatetime (No column Name)
Its empty...
i dont kw the reason ...
my column names r correct n the some is also there in my table ordermain
Actually am new to this environment ... plz help me ...
Thanks in advance
naresh
|
|
|
|
|
try to use convert function to extract date from ur field
select count(*) as [No Of Orders],convert(varchar,CreatedDate,103) as OrderedDate from inv_drugorder
where convert(varchar,CreatedDate,103)='11/05/2007'
group by convert(varchar,CreatedDate,103)
if it is not working or showing some errors pls mail me
sdf
|
|
|
|
|
please tell me how to find the 10th highest paid employee in an employee table whose attributes are empid,ename,sal,age,deptno
regards
saravan
|
|
|
|
|
try this:
select empid from where sal=
select sal from (select sal from group by sal order by sal desc )
where rownum=10
|
|
|
|
|
use tblEmployee
SELECT TOP 1 *
FROM (SELECT TOP 10 *
FROM tblEmployee order by sal) A
ORDER BY A.sal DESC
-- modified at 2:10 Thursday 24th May, 2007
Develop2Program & Program2Develop
|
|
|
|
|
Hi,
Is there a tool available which can convert SPs from Oracle to Sql Server style and vice versa.
Regards,
Blumen
|
|
|
|
|
Hi All!
i have column1 which has some values in it. i want column2 to calculate the sum of the values in column1 in each cell as shown below:
CL1 CL2
10 10
25 35
32 67
12 79
56 135
what is the query i need to write in order to acheive this.pl help me out.thanking in advance!!!
|
|
|
|
|
Since a databases work on the concept of sets of data there is no intrinsic order in which the data exists. The implementation of the database software may make it appear that data is in a certain order, but that cannot be relied upon.
In order to do what you want, you must first find a way to determine order. That might be through a primary key you already have, but didn't mention, or the creation of a new column that defines the order of the rows.
|
|
|
|
|
Ok, actually you can do this very easily. Simply use a reader to read all the values in column 1 and add them to the same variable. Then add the value of the new insert to that same variable. That variable will be you value for column 2. I can explain better if you don't understand.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
ExpertComing wrote: Ok, actually you can do this very easily. Simply use a reader to read all the values in column 1 and add them to the same variable. Then add the value of the new insert to that same variable.
You haven't taken into consideration the order of the rows. The OP has given no indication of how he determines the order. So, how do you know you are reading the rows in the correct order? Remembers any order that the rows appear in the result set are merely a quirk of the implementation and not guaranteed.
|
|
|
|
|
He is looking for a sum. With a addition(sum) order doesn't matter.
2+1=3
1+2=3
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Oh, I understand what you mean now. Let me think about how to do it, I have an idea but I want to think about it to make sure that it will work.
The only way to speed up a Macintosh computer is at 9.8 m/sec/sec.
|
|
|
|
|
Good morning
In messages system i have table to store messages and another table to contain the links which the message is posted through
Now i want to delete a link but i don't want to delete the message sent through this link
The problem:
When displaying the message sent what will be fount in the link field (i.e for the deleted link)
I tried to move the deleted link data to separate table (EX: deletedLink) but if the user added new link with the same name as the deleted link? The problem mainly in when displaying the message sent i will have the same link twice one for the deleted and the other for the added one.
If any one has a good idea for doing that please reply to me
I don’t want the sql code
I want just the idea
Thanks
mohammed Al maghraby
|
|
|
|
|
Here is one idea:
Check the table to see if that user has already added that link. If they have prompt them at that time to overide the existing link or to cancel.
Ben
|
|
|
|
|
First Thanks for interest
There is misunderstanding in the problem
I have to enable the user to a link with the same name because the original link supposed to be deleted
I.e. it doesn't appear in the forms of the application
So the user thinks that the link was deleted
Again
i want to delete the link because it became useless for me but at the same time there are message in the message table which are related to that link
And I don't want to delete them
Also at the same time after deleting the link the user wants to view a report about the messages which contain information about the link used for sending these messages
, after deleting the link where could I get the link information?...that is the problem
I hope the situation is clear
Again thanks for interest
Kind regards
mohammed Al maghraby
|
|
|
|
|
Ok, in that case add a new column called deleted or historical. The active link is set to 0 a link that has been deleted is set to 1. So when you return that link only return with a value of 0.
Hope that helps.
Ben
|
|
|
|