I have an order processing system, which needs to provide a customer with his position in the waiting queue for his order.
I tried to use the ROW_NUMBER() function in a CTE (Common table expression) and then select the row pertaining to the Customer. however it says i cannot use a ORDER BY...
thanks for your valuable thoughts.. an alternative to cursors i found out, is using Recursive CTE (common table expressions)
it makes for cleaner code. , but i suppose large tables would make this inefficient as well.. but for small sets it serves the purpose.
still not quite right... be mindful that these items can be moved around.. (eh..well not quite a queue.. more like a linked list then)... consider this
ItemNo PrecededBy
1 NULL
3 1
4 5
5 8
6 3
7 6
8 7
now its...
thats not quite right.. if u see closely the order of the items is determined by the PrecededBy field. so its actually ItemNo - 5 that is the last item in the queue. while your query would return ItemID 6.
I have a table structure that represents a queue, like so..
ItemNo PrecededBy
1 NULL
3 1
4 3
5 6
6 4
can anyone suggest any efficient ways of processing such a structure? for example if i need to find the last item in the queue etc..
im...
Thanks that helps..
but what if we need to update multiple columns based on the same subquery like so..
SELECT MAX(VER_ID),MET_ID FROM MEETING_VERSION GROUP BY MET_ID
since it is grouped, i need the MAX(VER_ID) for each MET_ID.
so i need to update both columns
any ideas?
I need to update multiple coulmns in a table based on multiple from a Crossrelated subquery.
the query to update a single column is as following
UPDATE VERSION VER_ID =
SELECT MAX(VER_ID) FROM MEETING_VERSION
any ideas on how to do this to update multiple columns?
Thanks , i also found out if you are actually doing the reads using a SP. you could use the following to avoid a block.
SET TRANSACTION ISOLATION LEVEL SNAPSHOT
Select * from MasterVersion
however u need to enable SnapShots at the DB level prior to this using
ALTER DATABASE DbName SET...
hi..
i have a periodic job running on a table. the job script includes a transaction. there is a separate .NET application accessing the table for data reads. due to the very large frequency of data reads, i need to avoid blocking by the job. how can i achieve this?
the following is a sample...
Im using VC++.NET as my IDE and create an ATL project using it. basically the program is a Wrapper DLL for a DLL already written in VC. the wrapper is written to interface between VB and the original DLL cos of type incompatibilities.
basically the problem is im unable to declare a variable...
I have a enum declared as follows
enum StatusLevels
{ eConversionStatusNone= 0,
eStatusInProgress = 1,
eStatusSuccess = 2,
eFailed = 3
} StatusLevels;
im using this within code to cast a variable of type short to the enum type as follows
StatusLevels eStatus;
eStatus=static_cast<StatusLevels>...
yes i have used the MIDL compiler with the IDL file to generate the gloabalenums.H file. however when i build the dll the tlb file shows only some of the enumerations when opened using OLEview.
when i say that some enums are visible to the VB side i mean.. that when u reference the C++ Dll in VB, u can actually see the enumerations and its constant values in the VB object browser.
this also means that within VB Code , i can use the enumeration members as a replacement for the values...
Im involved in maintaining a already developed application of which a major
component is written in VC++. i have a requirement to add a global
enumeration to the component. so that it maybe exposed to the VB application
tht is using the DLL.
currently global enumerations have been defined in...
I have a ASP.NET web application in which i need i have a multiline textbox in which part of the text need to be colored and highlighted. i can achieve the same thing in a windows app by using the Richtext box and its properties of SelectionStart, selectionColor and SelectionLength. however the...
i basically want to get a count of all distinct values in a specific column.
i have the following statement which returns unique tranid's . distinct clause is necessary cos table contains duplicate tranid's.
"select distinct tranid from temptransactions"
how do i get a count of these fields...
i have a transaction table that which looks somewhat like this, only a lot more data
TranID ITEM
1 soap
1 coke
1 bag
2 coke
2 apple
3 soap
2 apple
i have the following statement to show association rules...
is there anyway i can restore a Sql server 2000 backup on version 7..or any other way i can use the same database on version perhaps by attching the database
im trying to access 2 exchange server admin mailboxes.. each on a different LANs. on LAN 1 , im the server administrator . i created a mail profile under my name and opened it. and i was able to access the necessary info through CR . i created a diff mail profile under the name of the LAN 2...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.