Solved

SQL Server Query

Posted on 2011-09-05
3
199 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

726 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