Queries

  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Queries as PDF for free.

More details

  • Words: 137
  • Pages: 1
set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[Toc_sp_GetStudentNetworkByUserInfoId] @UserInfoId INT AS BEGIN /* SELECT u.UserId, u.UserName FROM aspnet_Users u WHERE u.UserId IN(SELECT ui.UserId FROM TOC_UserInfo ui WHERE ui.UserInfoId IN(SELECT un.LinkedUserInfoId FROM TOC_UserNetwork un WHERE un.RelationshipTypeId=1 AND un.UserInfoId=@UserInfoId)); */ SELECT ui.UserId, u.UserName, ed.Major FROM TOC_UserEducationalDetails ed JOIN TOC_UserInfo ui ON ed.UserInfoId=ui.UserInfoId JOIN TOC_UserNetwork un ON ui.UserInfoId=un.LinkedUserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId WHERE un.RelationshipTypeId=1 AND un.UserInfoId=@UserInfoId; END SELECT TOP 3 u.UserName,ui.PictureURL,ud.UserDescription FROM TOC_UserInterestUpdateDetails ud JOIN TOC_UserInfo ui ON ud.UserInfoId=ui.UserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId ORDER BY ud.DateAdded DESC; SELECT TOP 3 u.UserName,ui.ThumbnailPictureURL,ud.UserDescription FROM TOC_UserInterestUpdateDetails ud JOIN TOC_UserInfo ui ON ud.UserInfoId=ui.UserInfoId JOIN aspnet_Users u ON ui.UserId=u.UserId JOIN aspnet_UsersInRoles aur ON aur.UserId=u.UserId JOIN aspnet_Roles ar ON ar.RoleId=aur.RoleId WHERE ar.RoleName='Corporator' ORDER BY ud.DateAdded DESC;

select clkp.CompanyName,clkp.CompanyLogoURL,clkp.CompanySiteURL,cd.LookingToConnect from TOC_CompanyLKP clkp join TOC_CompanyDetails cd on clkp.CompanyId = cd.CompanyId where clkp.CompanyId = 20;

Related Documents

Queries
April 2020 7
Queries
May 2020 14
Queries
October 2019 20
Queries
November 2019 22
Queries
August 2019 35
Oracle Queries
June 2020 2