Solved

SQL Server Query

Posted on 2011-09-05
3
197 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql 2008 how to table join 2 31
Add a step to a system backup job 6 32
Display SQL 2008 last modified/update Database 11 47
SSRS 2013 - Finding Datasets/StoredProcedures 4 33
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

763 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