Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO Klijenti(Ime,Prezime,Drzava,Grad,Email,Telefon)
- SELECT P.FirstName, P.LastName, PCR.Name, PA.City, P.firstname+'.'+P.lastname+RIGHT(PEA.EmailAddress, 20),PPP.PhoneNumber
- FROM [AdventureWorks2012].[Person].[Person] AS P INNER JOIN [AdventureWorks2012].[Person].[BusinessEntityAddress] AS PBEA
- ON P.BusinessEntityID=PBEA.BusinessEntityID
- INNER JOIN [AdventureWorks2012].[Person].[Address] AS PA
- ON PBEA.AddressID=PA.AddressID
- INNER JOIN [AdventureWorks2012].[Person].[StateProvince] AS PSP
- ON PA.StateProvinceID=PSP.StateProvinceID
- INNER JOIN [AdventureWorks2012].[Person].[CountryRegion] AS PCR
- ON PSP.CountryRegionCode=PCR.CountryRegionCode
- INNER JOIN [AdventureWorks2012].[Person].[EmailAddress] AS PEA
- ON P.BusinessEntityID=PEA.BusinessEntityID
- INNER JOIN [AdventureWorks2012].[Person].[PersonPhone] AS PPP
- ON P.BusinessEntityID=PPP.BusinessEntityID
- INNER JOIN [AdventureWorks2012].[Sales].[SalesPerson] AS SSP
- ON P.BusinessEntityID=SSP.BusinessEntityID
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement