I have 3 tables (scenes, categories, scenes_categories ) in a many to many relationship.
scenes ( id, title, description )
categories ( id, title )
scenes_categories ( scene_id, category_id )
I'm having problems making a query to select scenes that must match multiple categories. For example, I might want to select scenes that match ca...
All of our correspondence is done via database mail in sql server. The data for document generation and the rules to trigger the generation are all on sql server. We now have to create a pdf file. I was planning on using pdfsharp/migradoc to do it, but then we'd have to create document and time its readiness with sql server data state...
For this MySQL SELECT statement:
SELECT * FROM MY_TABLE WHERE ID IN(x,y,y,z):
I want 4 rows back - ie I WANT row duplication for the case where I pass duplicate IDs in the list.
Is this possible?
...
Hi everyone,
I would like to do something like the following
UPDATE table SET column = other_column IN(complex_statement)
My question is whether this wold cause the complex statement to be evaluated for each row or not, which would obviously not very good for performance.
The alternative would be doing
UPDATE table SET column = 0;
...
In PHP/MySQL, what's the best way to generate a unique reference ID so that when a person submits his info to the database, he gets a reference number to follow up with his request?
I am already using the auto-increment feature from the database since the data needs to be unique every time a user submits information, but then I need to ...
I have database schema of order_lines as
product_id, quantity, created_at
I want to query result like
date 1 2 3 4 5 ..
product 1 count 2 ...
product 2 count 5 ...
Is it possible to do this in mySQL ?
...
I am changing from MySQL to PostgreSQL but can't find equivalent to MySQL's collation utf8_general_ci. What I'm trying to achieve here is to be able to compare strings using general language rules rather then binary comparison, i.e. í = i, š = s, ḩ = h, etc...
Is there a way how to make PostgreSQL search for strings using general langua...
Hi,
Here's another challenge for you SQL-gurus out there...
I wrote another question here on matching two result sets(http://stackoverflow.com/questions/1421842/how-to-match-compare-values-in-two-resultsets-in-sql-server-2008). This question is a sequel to that question and answer, but since its a different topic I'm creating it as a n...
I have a MS Access database with over 10 queries which need to be updated weekly. It is a real pain to export each one separately and then upload each one separately to the SQL on my server.
I have tried to connect my Access database directly to my SQL server, but my server does not allow that due to security reasons.
I have found a mo...
Tables
file_logs
file_id
user_id
files
id
name
etc ...
published_ratings
author_id
file_id
comment
etc ...
Scenario
I am creating a download log and need to display which files a user has rated as well as the unrated ones, this has to be done with 1 query.
I already took a crack at this,
SELECT
files.*,
IF(file_...
I have three tables, the first two fairly standard:
1) PRODUCTS table:
pid
pname, etc
2) CART table:
cart_id
cart_pid
cart_orderid etc
The third is designed to let people save products they buy and keep notes on them.
3) MYPRODUCTS table:
myprod_id
myprod_pid
PRODUCTS.prod_id = CART.cart_prodid = MYPRODUCTS.myprod_pid
Whe...
I was just thinking, how quick it would be to store the actual data of an application in a flat file.
Now, you can't just go storing everything in a flat file... sometimes sorts and searches are required, and to go through directories and files recursively could be a pain.
Now, imagine, you stored all your search-able data in a datab...
I have a VB.NET application that has been accessing MySQL stored procedures using .NET Connector 5.0.7. We recently upgraded to .NET Connector 5.2.6 and I now receive the following error:
"Procedure or function 'proc_scheduleProcess' cannot be found in database 'ProjectMgr'."
The following code has been running without issue until the...
I need to convert data in plain text columns into xml columns. However, not all of the content is valid XML, so I need to ignore any rows with invalid XML. Is there a way I can filter out the invalid data either using some sort of inline conditional convert or something in the WHERE clause?
...
I have two databases in SQL Server and i have a common table for both the databases an important big table which holds the foreign keys to other tables. The problem is the Table is in DatabaseA, and I need to refer foreign keys to this table from DatabaseB.
I know SQL doesn't support cross database referential integrity so what's the be...
I found this related question which confirmed a lot of what I already thought
but one question remains; how does a custom payment module integrate with the store's database?
I am developing a custom payment method that transfers the user to a secure site, hosted by a bank in Australia which will process credit card transactions. For t...
Moved a bunch of databases from sql server 2000 to 2008. One of the
applications is on JBoss 3.2.2 and is now failing to connect to the
database. The particular error is "The incoming tabular data stream
(TDS) remote procedure call (RPC) protocol stream is incorect.
Parameter 1 (""): Data type 0x38 is unknown."
I looked around google for...
Can anyone explain the SQL Server 2008 behaviour I'm seeing?
Given a simple table definition:
Column Type Nullability
id (PK) int not null
author_id int null
title varchar(255) not null
body varchar(MAX) not null
type varchar(255) null
comments_count...
Hello, is it possible to bind one row of an array to a drop down list?
The situation is I have a query that pulls the following data and puts it in an array using php:
student_id
class
teacher_code
times
THe idea is that I want the user to be able to book a time with the teacher of the class and only display the NON Booked times.
Obv...
The T-SQL MSDN page states
The timestamp syntax is deprecated.
This feature will be removed in a
future version of Microsoft SQL
Server. Avoid using this feature in
new development work, and plan to
modify applications that currently use
this feature.
Does this mean to suggest that the SQL Server Timestamp data type is ...