2,736 Topics
| |
OK, here is what I want to really do: I need to write a single SQL query to do the following: select count(1) from TableA where [condition1]/ select count(1) from TableA where [condition2] One way of doing it is: [CODE] select (t.numerator/t.denominator) as ratio from (select (select count(1) from TableA … | |
some times i connect to the localhost via Windows Authentication and i loggin normally, sometimes i get this error and after i restart the problem solve, now even if i restart always the same error :/ | |
Hi guys, am having an issue with a mssql query an running in mssql 2005 server. I have two tables debttable (customer, subcat, drugs, form, total, paid, date, balance qty and amount as columns) and debtsum(customer, subcat, total, paid, date, balance). Now since both tables have some columns in common, … | |
I have data in the column '4.00504572690003' when i use select round(4.00504572690003, 2) it gives 4.01000000000000 How can i achieve 4.00 from the same. I tried a lot but didint get. | |
Hi All, I have a table which holds the values like shown below [ICODE]ID Col-1 Col-2 Col-3 FID 1 Good Yes Easy 101 2 Bad Yes Hard 101 3 Good Yes Medium 101 4 Good No Medium 101 5 Good No Medium 101[/ICODE] I want to have a query which … | |
Good morning, Firstly, let me say that I have zero experience with database, servers, etc. Now that I have prefaced this long question with that tidbit let me ask the most basic questions. What is the difference between MySQL and MS SQL? I think they do the same thing but … | |
I am trying to set up a form for potential students to give their information for a language academay. When I tested the form with <input type="text" name"Nombre"> type of fields everything went fine. As soon as I tried to introduced drop down menus or typ radio elements the data … | |
I want to create menu structure from a database. For example, the database is the following: id name parent 1 x null 2 y 1 3 z null 4 a 3 5 b 2 The result should be: -x --y ---b -z --a Now, the algorithm I have on mind … | |
I have a stored procedure. This proc returns some data that needs to be put in an excel format. Is it possible to create a excel file to have the result of a select statement from the database? please help me out. Thanks | |
I'm using this to match a phoneNumber that is 10 characters in lenth. Is there a cleaner way to write this? [CODE]select * from a where TelephoneNummber not like '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'[/CODE] | |
Hi I have a MS SQL db script, I have the same temp table declared more than once. I keep getting this error: There is already an object named ????(question marks are representative of table name) in the database. the following resembles what my script looks like. [CODE] IF OBJECT_ID('tempdb..#table123') … | |
can any one tell me to find out the list of databases that have “.ldf” size greater than “.mdf”. | |
Hello, I'm using MySQL for a database containing 1 table with 10 columns. The point is to get a view of a few columns and use it in a web application So, I need 2 columns from this table - Pad(varchar) and Sequence(integer), then I create 8 views like this: … | |
[CODE]UPDATE table2 SET table2col1 = table1.col1, table2col2 = table1.col2, ... FROM table1, table2 WHERE table1.memberid = table2.memberid[/CODE] will the above query help me to update fields from one table to fields in another table base on a common id between the two tables? | |
Hi I have a issue that my application in currenlty doing number validation with an issue. I have a query that checks number is stored procedures but need more checks. [-d0-9] and checking that the lenth is 10 characters, all that is working as it should. The issue I'm having … | |
Hi all. I am trying to create a search that displays 3 columns. Analysis, Amount, Amount of Positiv results I have nailed down Analysis, Amount, but have problems displaying Pos. result. [CODE] SELECT DISTINCT SP.ANALYSIS AS Analysis,COUNT(SP.ANALYSIS) AS Amount FROM SAMPLE S INNER JOIN SAMPLE_PARTS SP ON SP.SAMPLEID = S.SAMPLEID … | |
Hi, everyone... I have a question about sql .. Question: Customer | jan-april | may - august| september - december A |quantity | | B | | | C | | | How to use the SELECT command to retrieve data and the output is show like above. please give … | |
Hey, I new in MS SQL I got one question don,t know how to solve..? Display code, name, place , total contract quantity for top 10 buyers how to write in MS SQL/...? | |
Hi, can anybody, please help me out. [CODE][B]select * from log where id <='%07%' [/B][/CODE] Am facing the syntax error, what is the actual query? my id look like this: 1.mtg10kl 2.mtg07kl 3.mtg06kl 4.mtg09kl I need the output this: 1.mtg07kl 2.mtg06kl please help me out .thanks in advance | |
I'm sorry if this should have been posted in the c# forums..... I have created a database for my website and am using MS SQL. This database will need to be accessed by users on the site itself, and from a .NET application. I am comfortable using MS SQL through … | |
Dear Sir, I want to silently instal SQLEXPRESS 2005 it is not working.... Please reply...becs i want to install SQLEXPRESS 2005 through my application... The command line used by me is "START /wait sqlexpr.exe /QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /ERRORREPORTING=0 /FEATURES=SQLEngine /INSTANCENAME=MSSQLSERVER /BROWSERSVCSTARTUPTYPE=Disabled /SECURITYMODE=SQL /SAPWD=123 /SQLSVCACCOUNT="NT AUTHORITY\SYSTEM" /SQLSVCSTARTUPTYPE=Automatic /TCPENABLED=1 /SQLSYSADMINACCOUNTS=".\User" ".\Administrator" /AGTSVCACCOUNT="NT … | |
hi, i have a question in C#.net report viewer. i want to create a report which will take a user input and generate a report. what i want is get the month from the user input and get it as a parameter for the sql query go get the result. … | |
I not sure how to do this.Could anyone can help me...? question: Display all buyer (code, name) who has average purchase each year for more than 100000 for past 10 years here is my query: [CODE]SELECT b.CODE, b.NAME from ( SELECT BUYER, AVG(TOTAL) AS total FROM SMF WHERE TOTAL > … | |
Hi, Am created a login and an user to access sql server instance and the database. [CODE]Creating Login: create login xxx with password='secret'; Creating User: use testdb; create user yyy for login loginname; [/CODE] And then i login with this login name(xxx) and also i can able to access the … | |
Hi, I have a table QuestionAsked which contains a column DateofAsking. Now what i need is to extract each date value and check whether the difference between that day and the current day is 14 or not. If yes than i have to update a particular column in that table.I … | |
I am attempting to pull a single record with the most recent affective date. However, I am getting two records with effective dates of 04/01/2010 and 12/01/2009. Can someone please tell me how to pull only the record with an effective date of 04/01/2010? Thanks for your help. [CODE] select … | |
Good Day All I have a File Format Defined like this [QUOTE]9.0 4 1 SQLCHAR 0 100 "," 0 ExtraField "" 2 SQLCHAR 0 100 "," 1 Descr SQL_Latin1_General_CP1_CI_AS 3 SQLCHAR 0 100 "," 2 ABREV SQL_Latin1_General_CP1_CI_AS [/QUOTE] and i use it like this [CODE]BULK INSERT dbo.TBL_CMPS FROM 'C:\\UNISA_IMPORT\\Final_Import\\Campuses.csv' WITH … | |
Hi expert, When i try this script i got 2 esn number with different shipdate and supplierid. were us it should be the latest shipdate should be obtain. Any Idea guys. thanks. [CODE] TABLE1 ESN 123 TABLE2 ESN--SupplierID--Shipdate 123--40----------2011-04-27 123--14----------2011-07-02 Select vp.esn, us.supplierid, us.shipdate --(Select Max(shipdate) from TABLE2 where vp.esn … |
The End.