Solved

SQL Server Query

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
TSQL - Rollup data set 7 29
How can I get this column in my query? 2 29
Write a function 5 24
SQl query 19 13
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

705 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

11 Experts available now in Live!

Get 1:1 Help Now