473,835 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Scalar Query in SQL Server 2000 like in oracle

Hi Gurus,

I have table (CallByCall) with following Data.

Input :
CallID Event DNIS UserID Time SeqID MobNo
-----------------------------------------------------------------------------
1 | 43 | 100 | |09:00:05 | 1 |
9833210770
1 | 40 | | |09:01:05 | 2
|
1 | 41 | | |09:02:05 | 3
|
1 | 42 | | 25 |09:03:05 | 4
|

2 | 43 | 200| |09:10:05 | 1 |
9833975536
2 | 40 | | |09:11:05 | 2
|
2 | 41 | | |09:12:05 | 3
|
2 | 42 | | 26 |09:13:05 | 4
|

3 | 43 | 300| |09:15:05 | 1 |
9813978536
3 | 40 | | |09:15:55 | 2
|
3 | 41 | | |09:16:05 | 3
|
3 | 42 | | 28 |09:18:05 | 4
|

4 | 43 | 100| |09:45:05 | 1 |
9223978896
4 | 40 | | |09:46:05 | 2
|
4 | 41 | | |09:47:05 | 3
|
4 | 42 | | 26 |09:48:05 | 4
|

Output:
CallID DNIS UserID MinTime MaxTime MobNo
--------------------------------------------------------------------------
1 | 100 | 25 |09:00:05 |09:03:05 |9833210770
2 | 200 | 26 |09:10:05 |09:13:05 |9833975536
3 | 300 | 28 |09:15:05 |09:18:05 |9813978536
4 | 100 | 26 |09:45:05 |09:48:05 |9223978896

In short I am getting DNIS and MobNo for Event 43 and
UserId for Event 42.

How can I achieve the above result?
Is it possible with scalar query?

Could any one help me for the same?

Thanking in Advance
Sanjeev
Mar 28 '08 #1
1 1860
"Sanjeev" <sa************ **@gmail.comwro te in message
news:37******** *************** ***********@s12 g2000prg.google groups.com...
Hi Gurus,

I have table (CallByCall) with following Data.

Input :
CallID Event DNIS UserID Time SeqID MobNo
-----------------------------------------------------------------------------
1 | 43 | 100 | |09:00:05 | 1 |
9833210770
1 | 40 | | |09:01:05 | 2
|
1 | 41 | | |09:02:05 | 3
|
1 | 42 | | 25 |09:03:05 | 4
|

2 | 43 | 200| |09:10:05 | 1 |
9833975536
2 | 40 | | |09:11:05 | 2
|
2 | 41 | | |09:12:05 | 3
|
2 | 42 | | 26 |09:13:05 | 4
|

3 | 43 | 300| |09:15:05 | 1 |
9813978536
3 | 40 | | |09:15:55 | 2
|
3 | 41 | | |09:16:05 | 3
|
3 | 42 | | 28 |09:18:05 | 4
|

4 | 43 | 100| |09:45:05 | 1 |
9223978896
4 | 40 | | |09:46:05 | 2
|
4 | 41 | | |09:47:05 | 3
|
4 | 42 | | 26 |09:48:05 | 4
|

Output:
CallID DNIS UserID MinTime MaxTime MobNo
--------------------------------------------------------------------------
1 | 100 | 25 |09:00:05 |09:03:05 |9833210770
2 | 200 | 26 |09:10:05 |09:13:05 |9833975536
3 | 300 | 28 |09:15:05 |09:18:05 |9813978536
4 | 100 | 26 |09:45:05 |09:48:05 |9223978896

In short I am getting DNIS and MobNo for Event 43 and
UserId for Event 42.

How can I achieve the above result?
Is it possible with scalar query?

Could any one help me for the same?

Thanking in Advance
Sanjeev

Replied in previous thread.

--
David Portas
Mar 28 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
35418
by: Saiyan Vejita | last post by:
I have the following SELECT query, the results of which I would delete from the table they're pulled from: SELECT A.* FROM SalesOrderPartPrices A WHERE EXISTS( SELECT 'Exists' FROM SalesOrderPartPrices B WHERE (A.SalesOrderNo = B.SalesOrderNo) AND (A.PartNo = B.PartNo) AND (A.UnitPrice = B.UnitPrice) AND
7
6536
by: Steve Jorgensen | last post by:
Hi all, I've been using scalar functions as a way to perform some complex data transformation operations, and I've noticed that scalar functions reaaaaalllllyyyy sloooowwwwww thiiiiiings dooooooown. I expect slow-down, of course, and would even not be surprised at slow-downs up to a factor of, say 50:1, but I'm seeing slow-downs more like 1000:1 or 100000:1. I'm sure it would actually be faster to actually export a table, use VB to...
7
1086
by: roger | last post by:
I'm having difficulties invoking a user defined table function, when passing to it a parameter that is the result of another user defined function. My functions are defined like so: drop function dbo.scalar_func go create function dbo.scalar_func() returns int
22
3075
by: Robert Brown | last post by:
suppose I have the following table: CREATE TABLE (int level, color varchar, length int, width int, height int) It has the following rows 1, "RED", 8, 10, 12 2, NULL, NULL, NULL, 20 3, NULL, 9, 82, 25
11
10763
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures execute in the database server with better performance? Please advise good references for Oracle stored procedures also. thanks!!
12
2328
by: Joe Stanton | last post by:
Hello Group I have a query that works in Oracle and SQL Server, but fails in Microsoft Access. The query is: SELECT data fromTABLE1 WHERE data>='A&' AND data<'A''' Here is my sample data:
5
5038
by: dreadnought8 | last post by:
I've worked with mdbs, and with SQL Server to a lesser extent, with Access as a front end, on commercial-strength systems for quite a while, starting with A97. The last 8 months or so, I've been working on Access 2000/2002 with pass through queries and linked tables to an Oracle 10g backend (ODBC). Access seems (still) to beat everything else hands down as a front end/ prototyping tool for WIndows based systems. With my type of small...
2
10014
by: mcleana | last post by:
I have a view that contains a complex query. A few of the columns call a function that returns a specific output. I also use a function to do a join as well. For example: SELECT l.ID, dbo.getStatus(l.ID) AS statusID FROM tableName A LEFT OUTER JOIN dbo.Status_LKP s ON dbo.getStatus(l.Leg_ID) = s.statusID
2
4218
by: nshishir | last post by:
In oracle, there is a performance improvement if scalar subqueries are used instead of joins. Does this hold good for Db2 (8.2) too?
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10808
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10520
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10560
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10233
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4433
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3088
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.