Im having trouble identifying my databases as correct and valid version of my model. I have a GUID-id for my model I could use, but where do I put it? I dont want an entire table with only one row for this GUID. Is there any metadata-repository for databases (SQL Server 2008) or is there any other methods of identifying databases except ...
Hey,
So I have a table (person), that contains columns such as persons name, age, eye-color, favorite movie.
How do I find the most popular eye color(s), returning just the eye color (not the count) using SQL (Microsft Access), without using top as there might be multiple colours with the same count.
Thank you
...
I have two tables one is table Profile and other is table Profile_location (stores the relation of a profile and a location). Problem:
A user can have multiple profiles, each profile has different locations. I want to find crossover of locations between each profile of a given user. In other words, evaluate all the profiles of a given u...
I need to get the strucure(field names and its datatypes) of a table ,that is in databaseA of serverA
...
Let's say I have two tables: one stores links and contains a link_id column, and the other stores info on how many times a particular link has been clicked and it contains a count column and the link_id column. What would be the query to the table in order to retrieve all the links along with the info?
...
Is it possible to cache recently inserted data in MySQL database internally?
I looked at query cache etc (http://dev.mysql.com/doc/refman/5.1/en/query-cache.html) but thats not what I am looking for. I know that 'SELECT' query will be cached.
Details:
I am inserting lots of data to MySQL DB every second.
I have two kind of users for ...
I have a table that contains link_ids that relate to another table; and this table has column titled ammount that stores values typed int. To retreive some total ammount along with individual values I query it as follows:
SELECT ip, ammount, (SELECT SUM(ammount) FROM stats WHERE link_id = $link_id) as total_ammount FROM stats WHERE link...
Hey, trying to figure out a way to use a file I have to generate an SQL insert to a database.
The file has many entries of the form:
100090 100090 bill smith 1998
That is,an id number, another id(not always the same), a full name and a year. These are all separated by a space.
Basically what i want to to is be able to get variables f...
Hello. I'm trying to make a query to retrieve the region which got the most sales for sweet products. 'grupo_produto' is the product type, and 'regiao' is the region. So I got this query:
SELECT TOP 1 r.nm_regiao, (SELECT COUNT(*)
FROM Dw_Empresa
WHERE grupo_produto='1' AND
cod_regiao = d.cod_regiao) as total
...
My tables are structured as below:
Questions
id title
1 what is this?
Answers
id answer qid
1 an 1
I want to select the question and all the answers in one single row through LINQ?
How can i do this?
...
Hello,
I am trying to connect to a MS-SQL server on the internet. What should I put on the ServerName parameter of SQLConnect?
I've tried this, but it fails:
"DRIVER=SQL Server;SERVER=SERVER_IP;DATABASE=sales"
SERVER_IP is something like 111.111.111.111,9999
EDIT:
I followed Johns advice and here is my current code:
SQLCHAR OutCon...
I have this php script:
foreach (get_all_topics () as $topic_id => $topic_info) {
$result = mysql_query("DELETE FROM marks
WHERE user_id = $user_id
AND topic_id = $topic_id", $db);
echo "DELETE FROM marks
WHERE user_id = $user_id
AND topic_id = $to...
I have a DB2 table with column "comments" that I would like to allow a user to have update access to, without giving them update access to the whole table.
I suspect that the answer will involve a view. However, in order to make the view relevant, won't I need to expose the primary key to the view? Won't the user then be able to update ...
I have a search form that I want my users to be able to enter English character equivalents for non-English characters.
For example.
To find Ælfred, the user could search for "Ælfred" or "AElfred".
the search should also be case insensitive so "aelfred" would work.
I also have it searching so that, by default, it matches the beginning o...
I'm using mysql table like this one:
| userid | regdate | question | answer |
-----------------------------------------------
1 2010-10-14 question 1 answer1
2 2010-10-14 question 2 answer2
3 2010-10-15 question 3 answer3
4 2010-10-16 question 4 answer4
I want to count...
Say I have a set of SQLite rows that have an auto increment field "_id", a string field "title", an integer field "type", and an integer field "number".
There are only a few types (i.e. 1, 2, 3).
All the number fields are currently blank, and I need to fill them with the numbers 1 through N for all rows of type 1. These numbers should ...
Hi,
I have the following schema.
Table votes
+------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------------------+----------------+
| id | int(10)...
I've got a real cheesy counter, just adds one to the counter field when a visit hits it. It's not counting page hits, but it's still cheesy.
What I need to do is stop someone from just hitting refresh over and over. What's the simplest was to get this done? Cookies?
I'd prefer not to log every visitor's ip address, etc... something sim...
Hi at all, i want to understand this:
i have a dump of a table (a sql script file) from a database that use float 9,2 as default type for numbers.
In the backup file i have a value like '4172.08'.
I restore this file in a new database and i convert the float to decimal 20,5.
Now the value in the field is 4172.08008
...where come from the...
I am trying to search a table where the field name does not have a list of strings in it. I use:
SELECT *
FROM members
WHERE name NOT IN ('bob', 'jim', 'leroy');
but it still returns matches containing those words. I have searched high and low for the answer to this. Can anyone help?
...