|
Hi
Can anyone tell me if i purchase SQL2005 standard with 5 cals, whether it will allow more than 5 users connected as my numbers are up and down and i dont want to purchase too many cals for startup of project.
I know with sql2000 its ok to go over.
Thanks
Dom
|
|
|
|
|
So I have a database with multiple records with the same agtMast field. What I need to do is select unique agtMast records, but i need the whole record. I know this will select the unique fields...
SELECT DISTINCT agtMast
FROM table_name;
...but it only selects the agtMast field and I need the entire record.
Any help would be greatly appreciated.
Nathan Lindley
|
|
|
|
|
Well, say there are 3 rows
agtMast ID Name Other
One 22 James Other1
One 22 James Other2
Two 22 Bond Whee!
There are 2 distinct values for the agtMast column, but 2 possible sets of values are different. Do you want one row for each agtMast value, and are there specifics as to which one should be selected, or do you want the distinct sets of values (So if One/22/James/Other1 appeared 10 times, you would want it to appear only once, but have One/22/James/Other2 appear as well after the query)
I need some more information as to how you're clarifying the "correct" row.
|
|
|
|
|
Thanks for the reply Drew.
What I am looking for is just one of each of the agtMast (which is the agent's code) records. What the situation is is before on the old system, they listed each agent every time they changed an address (instead of updating, they just added new rows). What I need to do is just get one of the records (1 for each agtMast code, but no more than 1), for the main contact information and if the address is not the current one, it doesn't matter. I would just put the DISTINCT records into a holding table, but i'm not able to grab just a single record for each DISTINCT agtMast.
Thanks again for the reply!
Nathan Lindley
|
|
|
|
|
|
Thanks for the reply Ed.
How can I use group by agtMast if the select includes more columns than the agtMast?
Nathan Lindley
|
|
|
|
|
I don't mean to be condescending, but are you familiar with the GROUP BY clause?
|
|
|
|
|
Well, you can't include a column in the select statement without it being contained in either an aggregate function or containing it in the GROUP BY clause.
Nathan Lindley
|
|
|
|
|
Exactly. I must be missing something on your requirement. You want one record per agtMast, and you want the other columns also. You have to determine what you want from the other columns.
For example:
SELECT agtMast, MAX(CustName), MAX(DateIssued)....
FROM table_name;
|
|
|
|
|
Yea, I used MIN(), but what I essentially did was MIN(column1) As Column1, etc.. and inserted the records into a temp table, cleared the original table, and then loaded the records back into the original table. I don't know why I didn't do this in the first place, but i guess i was looking for a more concrete way to do it. Oh well, this works.
Thanks again for the responses!
Nathan Lindley
|
|
|
|
|
Hi all.
I had some problems with my previous SQLserver so I decided to uninstall it.
I uninstalled SQLserver from add/remove in control pannel. also there was a folder named microsoft sqlserver in C/program files , I deleted that folder too .
then,I restarted my PC . after that,I put the CD and wanted to install it again...but aftar I clicked on the first "next"button,it was an error and didnt install :
the error is this : "a previous program installation created pending file operations on the installation machine.You must restart the computer before running setup"
but I restarted many times but the error is still here and I cant install the SQlserver.
please help me and answer me ... what should I do ?
|
|
|
|
|
|
thank u very much.
I have installed the SQL server 2000 but I have problem...
I cant register a new sql server ... the connection failed error has appeare on my local . why ?
I dont have any sql or database in enterprise. please help me.
thanks alot
|
|
|
|
|
i am new to asp/sql and of course, i have some problems with it.
please let me explain:
i have a problem with a sql result and its output in asp
my sql result table looks like this
city date payment total
================================================
city1 1/1/2007 Visa 123.32
city1 1/1/2007 Mastercard 23.30
city1 1/1/2007 AMEX 40.30
city1 1/2/2007 Mastercard 12.30
city1 1/2/2007 AMEX 234.20
city2 1/1/2007 Visa 111.11
city2 1/1/2007 AMEX 222.22
city2 1/3/2007 Visa 233.33
city3 1/1/2007 Visa 123.23
city3 1/1/2007 Mastercard 45.34
....
and so forth
there are 3 fix payment options I want to show always: Visa, Mastercard
and AMEX.
I would like to output this result table shown before as followed in
asp:
First sorted by city, then date, and then always followed by 3 fixed
columns for the payment types
City1 Visa Mastercard Amex
-------------------------------------------------------------------
1/1/2007 123.32 23.30 40.30
1/2/2007 - 12.30 234.20
next city
City2 Visa Mastercard Amex
-------------------------------------------------------------------
1/1/2007 111.11 - 222.22
1/3/2007 233.33 - -
next city
City3 Visa Mastercard Amex
-------------------------------------------------------------------
1/1/2007 111.11 - 222.22
1/3/2007 233.33 - -
I tried it with looping while checking if date and city changed.
however, every time i try it, i can't show it properly like the way i
want it.
Please, can somebody help?
If you need more information, please let me know.
thank you so much.
|
|
|
|
|
select City, PaymentDate,
sum(case PaymentType when 'Visa' then PaymentTotal else 0 end) as Visa,
sum(case PaymentType when 'Mastercard' then PaymentTotal else 0 end) as Mastercard,
sum(case PaymentType when 'Amex' then PaymentTotal else 0 end) as Amex
from PaymentTable
group by City, PaymentDate
order by City, PaymentDate
|
|
|
|
|
Thank you so much Andy!
I really appreciate this, that made my day.
Thanks
|
|
|
|
|
Hi,
Need a simple create table script for SQL server 2007.
Here's the structure:
Column1: primary key, integer, auto increment
Column2: Name, char, length 100, not null
Column3: address, char length 200, not null
Please help
ASP - AJAX is SEXY. PERIOD.
|
|
|
|
|
|
Can anyone help me out please? I keep getting errors when importing msado15.dll even when removing the one error that microsoft identified as a bug. For win ce 4.23, is it even possible?
|
|
|
|
|
Hi
I have exported pubs authors table into flatfile. I am trying to import the same flat file data into dataset in C#. Could you any one help me please.
Data from flat file to Dataset(same format like authors table).
kesavan
kesavan
|
|
|
|
|
|
Guys, can any body suggest a place where i can get general information about sql server(2000-2005 other than google and MSC book.
Thanks
|
|
|
|
|
|
thanks hasan
|
|
|
|
|
Hello,
I have the following sql which will be stored a string, to be executed.
However, it gives me a syntax error -> Incorrect syntax near the keyword 'not'.
This is because sql server thinks its a keyword, how can I format my sql so that the arguments can be passed correctly.
<br />
BEGIN<br />
SET @SQL = 'CREATE PROCEDURE [dbo].[incident_selAllFilterRows]<br />
AS<br />
SELECT incidentID, company, subject, contact, phoneNo, assignedTo, priority<br />
FROM incident<br />
WHERE [status] = 'not started' AND [status] = 'in progress''<br />
EXEC sp_executeSQL @SQL END<br />
Many thanks,
Steve
|
|
|
|