Hello
I have some data like this but more than 1500000 records and more than 700 users:
usercolumn , datecolumn\
a1 , 1998/2/11\
a2 , 1998/3/11\
a1 , 1998/2/15\
a4 , 1998/4/14\
a3 , 1999/1/15\
a2 , 1998/11/12\
a2 , ...
Hi,
For example, if I did:
SELECT * FROM Users WHERE UserId BETWEEN 100 AND 1
what would the results be?
Edit: Sorry, you're right, I should have specified. I didn't want to know the exact number of rows that would return, I just wanted to know if it would return rows that were between 1 and 100 or if it would return rows from min(U...
Hi,
In my database I have a table called ThingsInACircle. Every time a Thing is added to the ThingsInACircle, it gets added with a ThingId that is auto incremented.
Imagine the Things in this table as being in a circle. SELECT Thing FROM ThingsInACircle WHERE ThingId = 10 is next to SELECT Thing FROM ThingsInACircle WHERE ThingId = 11....
Hi,
I have an SQL Query that i'm running but I only want to select a specific row. For example lets say my query was:
Select * from Comments
Lets say this returns 10 rows, I only want to select the 8th record returned by this query. I know I can do:
Select Top 5 * from Comments
To get the top 5 records of that query but I only wan...
I'm a newbie so bear with me. I'm making a little forum for fun. Check it:
Categories:
`id` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`position` int(11) NOT NULL,
PRIMARY KEY (`id`)
Forums:
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`position...
I've trying to streamline an intranet application where some of the data is stored locally on the postgresql database of the intranet server and other related data is stored in our enterprise oracle 10g2r2 database.
What I would like to do is create a view on either database box wouldn't really matter that combines for simplicity sake...
$thread_id = (isset($_GET['id']));
$thread_id = intval($_GET['id']);
$q = mysql_query("SELECT * FROM threads WHERE id = $thread_id");
Can't you use two functions on one variable?? As you can see I check if its set but it still gives me:
Notice: Undefined index: id in C:\wamp\www\bfhq\thread.php on line 7
...
Maybe I'm having a really bad day, but could someone possibly help me to turn this:
MessageID | SendingUserID | ReceivingUserID
-------------------------------------------
1073 | 1002 | 1001
1065 | 1001 | 1002
1076 | 1008 | 1002
Into:
MessageID | SendingUserID | ReceivingUserID
--------------...
I am using Sql Server 2008. My Stored Procedure accepts almost 150 parameters. Is there anything wrong with that performance-wise?
...
Are they less vulnerable to SQL injection than doing stuff like mysql_query("SELECT important_data FROM users WHERE password = $password")?
...
i want the statment of how to update the same column in more than one table in the same sql database but these table are related to each other through that column who is primary key in one and forgin key in the other tables with C# please help me
...
I am working on a console application to insert data to a MS SQL Server 2005 database. I have a list of objects to be inserted. Here I use Employee class as example:
List<Employee> employees;
What I can do is to insert one object at time like this:
foreach (Employee item in employees)
{
string sql = @"INSERT INTO Mytable (id, name,...
Hi I have the below query which i want to det the distinct districts and how sum of how many properties are for each one but i cant remember how to do the sub query!!!
Can any one help please
SELECT DISTRICT, PROPREF
FROM TBL_PROPERTY
WHERE (CONTRACT = 'ma2') AND
(LASTSERVICEDATE <= DATEADD(HH,23,CONVERT(DATETIME,'30/05/2009'...
Guys,
My company at present has the following Setup:
127 SQL servers (2000 and 2005) and over 700 databases. We are in the process of server consolidation and are planning on having a Master server / Target servers setup to enable centralized administration. As part of this project, I have been given the responsiblity of creating a scr...
Hi,
I'm making a digg-like website that is going to have a homepage with different categories. I want to display the most popular submissions.
Our rating system is simply "likes", like "I like this" and whatnot. We basically want to display the submissions with the highest number of "likes" per time. We want to have three categories: ...
For some reason I cant post text longer than about 40~ characters..
The code
// remove space
foreach($_POST as $key => $val) $_POST[$key] = trim($val);
// check for empty fields
if (empty($_POST['comment'])) {
header("Refresh: 2; url=$_SERVER[REQUEST_URI]");
exit('<div class="error_msg">You can\'t post a blank message.</div>');
}
//...
Ok, I'm trying to make an indexed view that is against a simple table that stores the results of what people think is good/bad for a post. This is the results of a thumbs up / thumbs down, voting on posts.
So here's my pseduo fake table :-
HelpfulPostId INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
PostId INT NOT NULL,
IsHelpful BIT NOT NULL...
I have the following set of dates (dd/MM/yyyy) matching events in my database:
eventId startDate endDate
1 02/05/2009 10/05/2009
2 08/05/2009 12/05/2009
3 10/05/2009 12/05/2009
4 21/05/2009 21/05/2009
5 25/05/2009 NULL
6 01/06/2009 03/06/2009
The ev...
hey everyone,
Im trying to create a view out of quite a complex select query and it wont let me put a clustered index on it because i have to use subqueries and some aggregate functions.
I have to get a clustered index on it otherwise the queries that use the view will take forever. Apparently sql server will only store the result set ...
this is my statement that throw exception says "can;t convert from string to smalldatetime value " pleaze help me to fix it or write the correct statement
da = new SqlDataAdapter("SELECT name,[build-id],exitTime,enterTime,tagType FROM Employees,GateLogging WHERE GateLogging.tagType='Employee' AND enterTime=DATEDIFF(minute,GateLogging.en...