Skip to content

Tag: sql

PLS-00201: identifier ‘COL1.POTO’ must be declared

Hi I have problem with variable: Here is my code The Osoba table: It’s my first post so don’t be so angry for formatting. Answer This can be done with a single efficient SQL statement. I highly doubt that the SELET statement and the general logic in your code is correct. CROSS JOINs create a carte…

Tricky MySQL view

I am finding it very difficult to create a view in MySQL, and hope someone could help me out. This is the schema of my db: This database collects a series of football games and many characteristics for each one, as well as all the teams and the seasons. Thanks to this view (https://stackoverflow.com/a/7079444…

Extracting hashtags by sql

I have this problem – currently I am extracting hashtags in a C# application but now I want to move it to SQL Server. In C# I have code using a regex: In T-SQL, I would like to have something like this: Answer Using the string_split

Combine Date and Time Fields and Order By DateTime Field

I would like to combine the date and time for meta values performance_date_1 and performance_time_1 and then sort by this new DATETIME value. Here is my SQL query so far, but no luck. Query SQL: SELECT TIMESTAMP(performance_date_1, performance_time_1) as DateTimeTS FROM test ORDER BY DateTimeTS; Because of ho…

MYSQL Query select only first record of foreign key

First of all, I am pretty new to MySQL. I am currently stuck with the following query. I have several tables that have relations between each other. Every user can create multiple projects. Every project can have one attachment, multiple attachments (images) or no attachment at all. Every project only has one…

How do combine two Queries or is it only one?

Question: How do combine two Queries or is it only one? Example: I have two exact similar tables my PostgreSQL Database. info_table and info_table_dump with the exact same columns date_at, name, color and length . Now i want to know if there are entries in info_table_dump that do not exist in info_table. Ther…

Missing query data when using Sum

My database in Microsoft Access looks like this: Every Client can have many assistants. Every Assistant may have one client or no clients at all. Assistant have a Nice field which is Boolean, indicating whether the Assistant is nice. I need a query where I can get all of the clients, together with a boolean v…