Solved

SQL Server Query

Posted on 2011-09-05
3
195 Views
Last Modified: 2012-08-14
Can any one explain following query?

SELECT 
	vchDeviceID[DeviceID],
	DeviceName[DeviceName],
	tblDevices.DeviceID[ID], 
	CustomerID[custId], 
	tblDevices.IsActive, 
	ColorCode,  
	dbo.GetLastCustomerLongitude(tblDevices.DeviceID) as Longitude,  
	dbo.GetLastCustomerLatitude(tblDevices.DeviceID) as Latitude ,
	tblSubscription.isActive as IsPaid 
FROM 
	tblDevices  
	inner join tblSubscription on tblDevices.DeviceID = tblSubscription.intDeviceID  WHERE tblDevices.DeviceID = @intID

Open in new window


- Deepak Lakkad
0
Comment
Question by:Deepak Lakkad
3 Comments
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
ID: 36486731
It joins two table tblDevices  and  tblSubscription based on the given condition. It means that, the condition satisfied items from 2 table records are given as result.
Where condition is used to filter the result further. The name within [] is just alias name. dbo.GetLastCustomerLongitude(tblDevices.DeviceID) is user defined function. That function should be exist in the DB. The result is shown in result set.

sp_helptext  GetLastCustomerLongitude will give the function in text.
0
 
LVL 11

Author Closing Comment

by:Deepak Lakkad
ID: 36486773
Thank your very much
0
 
LVL 42

Expert Comment

by:dqmq
ID: 36486782
It returns information for a specific device and it's subscription statuses, provided it has one or more subscriptions.  
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now