Skip to content

Tag: sql

SQL – get the value of the related update by date

Say I have 2 tables Orders: And I have a table that contains updates of the dollar to pound values on various dates My goal is to query for the pound price, using the updated price for the time, so I get something like this How can I connect the 2 tables? Using equals won’t work, as Answer You could

How to get list of custom user types for listed stored procedures?

I was able to find way to find custom user types for one stored procedure: How should I use this function for comma separated list of stored procedures? Answer If you have it available (SQL Server 2016 and newer), you can use STRING_SPLIT to split your list and then use CROSS APPLY to call the function for ea…

how to retrive data from VARRAY and filter it

i have to retrieve specific data from Varray for example i want to retrieve the name where VARRAY includes AC1 i tried select * from exprement where seat=’AC1′; Answer You can use: or As an aside, if you defined seat as a nested table (rather than a VARRAY) then you could use the MEMBER OF operato…