2,736 Topics

Member Avatar for
Member Avatar for ashishsax

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 …

Member Avatar for ashishsax
0
300
Member Avatar for DarkBerzerk

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 :/

Member Avatar for adam_k
0
60
Member Avatar for SAINTJAB

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, …

Member Avatar for SAINTJAB
0
237
Member Avatar for Arjun_Sarankulu

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.

Member Avatar for adam_k
0
61
Member Avatar for anish.anick

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 …

Member Avatar for adam_k
0
75
Member Avatar for DmytriE

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 …

Member Avatar for Netcode
0
179
Member Avatar for aci.herobo

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 …

Member Avatar for antonioatt
0
204
Member Avatar for Srcee

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 …

Member Avatar for buddylee17
0
227
Member Avatar for jacksantho

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

Member Avatar for buddylee17
0
319
Member Avatar for Singlem

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]

Member Avatar for BitBlt
0
57
Member Avatar for 007tron

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') …

Member Avatar for 007tron
0
4K
Member Avatar for Ashoksql

can any one tell me to find out the list of databases that have “.ldf” size greater than “.mdf”.

Member Avatar for mikemsq
0
112
Member Avatar for pepyrs

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: …

Member Avatar for pepyrs
-1
202
Member Avatar for springposh

[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?

Member Avatar for Netcode
0
52
Member Avatar for Singlem

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 …

Member Avatar for debasisdas
0
108
Member Avatar for lcfjoertoft

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 …

Member Avatar for lcfjoertoft
0
152
Member Avatar for Dumb Fish

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 …

Member Avatar for Netcode
0
142
Member Avatar for minbor

Hello, I need to connect to a DSN on a remote computer. I have found a lot of a lot of info on how to connect to a remote database from a local DSN, but nothing on connecting to a remote DSN. I am using asp.net, but help on solving …

Member Avatar for minbor
0
464
Member Avatar for Dumb Fish

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/...?

Member Avatar for Netcode
0
106
Member Avatar for jacksantho

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

Member Avatar for jacksantho
0
104
Member Avatar for eatatj0s

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 …

Member Avatar for Netcode
0
193
Member Avatar for nirgunpratik

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 …

0
64
Member Avatar for judithSampathwa

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. …

Member Avatar for judithSampathwa
0
472
Member Avatar for Dumb Fish

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 > …

Member Avatar for urtrivedi
0
107
Member Avatar for jacksantho

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 …

Member Avatar for adam_k
0
222
Member Avatar for arsheena.alam

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 …

Member Avatar for arsheena.alam
0
220
Member Avatar for wfbp

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 …

Member Avatar for jbisono
0
136
Member Avatar for vuyiswamb

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 …

Member Avatar for DCS09
0
350
Member Avatar for judithSampathwa

hi, i am using sm sql express 2008 and this does not have the backup feature. so i have to create a application to back up the database everyday automatically, does anybody know a way to do it,please reply thank you.

Member Avatar for omar isaid
0
148
Member Avatar for jovillanuev

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 …

Member Avatar for jovillanuev
0
157

The End.