2,736 Topics
| |
Hi, I'm having trouble building the correct syntax select statement for a system to handle support tickets. The table "tickets" has the following columns: id (int) inserted (smalldatetime) ticket_id (nvarchar) owner (nvarchar) subject( nvarchar) category (nvarchar) message( nvarchar) status (nvarchar) The id is unique for each record but the ticket_id … | |
| [I]In this example I'm using the AdventureWorks database in MS SQL Server 2005[/I] I was wondering what other people thought about Schemas vs. Roles when it comes to security access. If you have an employee who just started working for Human Resources and needed access to all the database objects … |
Hi, I have a derived attribute in my table and I'm sorting the table in the descending order of this attribute. My query should retrieve all the tuples which have the maximum value for this derived attribute. If I use SELECT TOP 1, I'm only getting one of the required … | |
Heya, what i would like to do in one query is pull out two objs, that are very similar from the same table "ol_obj_data" These two objs are "ratings" and "reviews" they are not linked except for a USER_ID of who submitted them. But they relate to our business data. … | |
The two queries are returning two different no of rows.Outer join is not supposed to duplicate the rows in the first table right?How do I correct this. [code=sql]select * from clientcode order by cc_clientcode result:(5627 row(s) affected) select cc.cc_clientcode,cc.cc_rmcode,cc.cc_panno,cc.cc_productname ,c.Client_panno,c.client_userid from clientcode cc LEFT outer join client c on cc.cc_panno=c.client_panno … | |
Hi everybody, I have really damned trouble here... On MSSQL 2000 I have something about 140 log tables with three columns in each one. "ID" AS INT, "SomeTextCODE" AS NVARCHAR(20) and "SomeTime" AS DATETIME I made a view (v_SomeView_ALL) in which there are all these tables united. But some SomeTextCODEs … | |
Can anybody explains me why following sql statements do not work with mssql? create table place (id int primary key, name varchar(64), parent_id int references place (id) on delete cascade); create table transport (id int primary key, name varchar(64)); create table trip (id int primary key, from_id int references transport … | |
im in the process of looking at a reporting tool for my database system - can anyone point me in the right direction for the best product available. i previously used crystal a very long time ago (it may be called something else by now) but ive read alot about … | |
Hi I'm to stupid to write sql but im trying my hand at it anyways. I cant work this out any easier than doing a seperate command but when i do that it takes forever. So i tried doing it as a subquery, but i think somehow i need to … | |
Hai, ive created a SQL database, but now i want to place and use this on another PC. Is it possible to write the database files to a CD or DVD and then copy it to another PC? If yes then please explain how. Thank you | |
Hi ALL, The project we're working on is a document retrieval system. Two kinds of Features for each document in a repository are extracted as described in table-1 and table-2. Table1 DocID Word Freq 1 Book 9 1 Study 3 2 Work 4 2 Run 5 2 User 2 3 … | |
Hello, I would appreciate if anyone could help me with this. I'm new to this sort of thing and don't really know where to start. I have a survey results table that looks like this: [CODE]user question answer Mike 1 2 Mike 2 1 Mike 3 5 John 1 5 … | |
Hello, I've just migrated a website built with asp and MsSQL to a new server. The old server used MsSQL 2000 nd the new one uses MsSQL 2005. I know the database became slightly corrupted when it was uploaded. I was just wondering if anyone could tell whether the varchar … | |
Hi, I am trying to break each record into 2 records but failed Is it possible? What is the correct way to do it? Thanks in advance!!! For Example: I have a table that contains 100 records . Each record has the following 10 columns: Col1, Col2, Col3, Col4, Col5, … | |
Hi everyone, I'm trying to write a stored procedure select statement which is a little beyond my experience level. I have a table in the DB called addresses which contains the following fields: [LIST] [*]address, VARCHAR [*]count, INT [*](a few more fields) [/LIST] My stored procedure will take in a … | |
Hi all I am pretty new to MSSQL and have a problem. The solution is probably very simple but I cant find it :) I have a database field ZIP, I also have string with consists of a number of UK part postcodes eg 'S10 S11 S7 S17 S8 S3 … | |
HAI, I'm creating a website for a computer forum (using VBScript, SQL server - back end). Im able to display the heading of the threads in a page & also im able to click and redirect to a proper .asp page but, can u tell me how can i show … | |
I have an external application running on a MS SQL server2005 (express-edition) database. I need a notification each time the application reads a special table from the database. As a new user of MsSQL I experienced with the trigger function. But this is only applicable when fields in a table … | |
Hello, I am trying to figure out how best to merge these two queries together: #1 - this is pretty basic: [code=sql] SELECT DISTINCT [vtebase].[EbLastName], [vtebase].[EbFirstName], [vtecomp].[EmAnnual], Str(vtecomp.[EmAnnual] * 1.03,9,2) AS [3% Increase], Str(vtecomp.[EmAnnual] * 1.05,9,2) AS [5% Increase], Str(vtecomp.[EmAnnual] * 1.07,9,2) AS [7% Increase], [vtEqbase].[EqDateNext] AS [Next Review Date], … | |
hi, i hav some problem involving checkboxes 1.how do i submit the values into the database 2.i dont know how to connect with the db below is the sample of my codings p/s;the values of the checkbox will have calculation in the db,can i relate two tables? [code=html] <td><input type="checkbox" … | |
I just started learning php and mySQL, if i want to create 2 tables, how do i connect them with a foreign key? In oracle, it is something like below, would any one point out what have to change to make it work in mySQL? phpMyadmin GUI doesn't seem like … | |
I need help with a left outer join on a table and some queries (is it possible to outer join with queries?) here's my SQL right now [CODE]SELECT Clients.ClientID, Clients.SSN, Clients.WholeName, Clients.Address1, Clients.Address2, Clients.City, Clients.State, Clients.ZIP, Clients.HomePhone, Clients.WorkPhone, Clients.OtherPhone, DPs.SumOfAmount AS [Client Down Payments_SumOfAmount], Remain.SumOfAmount AS [Client Remaining_SumOfAmount], [MF PTD].SumOfAmount … | |
Hello, I've been given the task of transferring a website from one server to another. Unfortunately the website was written in asp and is linked to a MS SQL database and I haven't had much experience with either. It was using a MS SQL 2000 database but the new host … | |
hi, iam having three tables as shown below table 1 table 2 table 3 column1 id column1 cust_id column1 cat_id column2 cust_name column2 cat_id column2 cat_name column3 cust_id column3 training column4 posted_date iam using the following query Select A.id,A.cust_name,B.training from table1 A,table2 B,table3 C WHERE A.ID = B.cust_id AND B.cat_id … | |
Why is the result of this query.. [code=mssql] SELECT * FROM (SELECT TOP 5 * FROM (SELECT TOP 20 * FROM ODPSEnrlAccts ORDER BY fld_acctname) AS foo ORDER BY fld_acctname DESC) as bar ORDER BY fld_acctname DESC [/code] Is the same as the result of this one.. [code=mssql] SELECT TOP … | |
I need to write a stored procedure to analyse appointments for the last 12 months. I need to get each salesperson (by ID) and for each person carry out a count of the number of appointments and count them by outcome (sale, second meeting , failure etc.) and then display … | |
[INDENT][INDENT]--URGENT--[/INDENT][/INDENT] Ive written a code in VBScript in ASP where back end is SQL. Here I want to display all the records with the data of the selected field of the table "Users" but it displays only the first record repetitively for the total number of records in the table … | |
Below query for comparing 2 tables and extract the uncommon like GUID X121 doesn’t exists in the 2nd table and the GUID which are unsuccessful (has –ve values). select isnull(pt.GUID,Wo.GUIS)as GUID, pt.[ErrorNo] as Error from PieTreace pt full outer join WorkMessage Wm on pt.GUID = Wm.GUID where(pt.GUId is null) or … | |
Say we have a table with 1000 rows and there is no column which can identify a row(i mean no Identity or unique column) now if we want to select a set of rows from this table how can we do that? Ex: i want to select from rows 201 … |
The End.