Skip to content
Advertisement

Tag: sql

SQL join rows from second table as columns

This is probably a duplicate question, but I couldn’t find it. Maybe I’m thinking about this backwards. How do I format a query to return the results like this with the source tables below? Filename Attr1 Attr2 Attr3 Configuration file1.txt Val1 Val2 Val3 Default file1.txt Val1 Val2 Val3 First Documents Table DocumentID Filename 1 file1.txt VariableValues table VariableID DocumentID ValueCache

How to insert images of picture box which is created by for loop?

If user enters 5 this loop creates 5 pictureboxes Here I have a click event for selecting image of each picture box My question is… How can I insert those images of pictureBoxes into SQL SERVER at once? can anyone help ? appreciate it. Answer If you have 5 picture boxes in your application and in your database table there

Insert date now + interval 2 days

for some reason I am getting a syntax error: From what I’ve read this should be the correct syntax. Answer The interval value needs to be enclosed in single quotes: The specification ‘2 days’ as a single string is a Postgres extension to the SQL standard. A SQL standard compliant way of writing this would be interval ‘2’ day or

Why does sqlite3 not escape metacharacters with parameterized values?

I’m making a database interface in python for a project where i need to encrypt everything that goes into my database and decrypt everything that goes out of it. Unfortunately some of my characters get encrypted to meta characters in sql and this gives trouble when selecting something from the database. The first thing that came up was to use

How do I use SQL to search a many to many relationship using AND

Can anyone help to create a SQL code which could list movies which have been searched under 2 or more tags for the tables below? E.g. I want to list all movies which have the tags “4star” AND “Drama”. Tables I have managed to create one which lists movies which have either one or another tag… thus. Which gives Star

Year, Next Year, Quarter e Next Quarter based in a FISCAL YEAR

I need to bring the results of this SQL showing all the data of “MY FISCAL YEAR” that started in 1st june, and other SQL to showing all the data of the “NEXT FISCAL YEAR”, because I made it based on the database calendar. btw, the last fiscal year ended in 31 MAY The user will sent the request with

How to correctly compute cumulative distribution on sample dataset

Consider the following table and data set. I want to create a cumulative distribution that shows cumulative % of total Callers based on the values in the Callees column, for the group. For example, for the value Callees = 1, I would like the first output row: Where 0.6662 is 505 divided by total number of Callers, 758.Then the following

Advertisement