Viewing 15 posts - 1,831 through 1,845 (of 2,007 total)
--Start by making some test data
DECLARE @TABLE AS TABLE(
[COMPANYNAME] VARCHAR(35),
[USER_id] VARCHAR(3))
INSERT INTO @TABLE([COMPANYNAME],[USER_id])
SELECT 'Company A', '101'
UNION ALL SELECT 'Company A', '102'
UNION ALL SELECT 'Company A', '103'
UNION ALL SELECT 'Company B',...
July 28, 2010 at 10:35 am
DECLARE @TABLE AS TABLE(
id UNIQUEIDENTIFIER)
INSERT INTO @TABLE
SELECT Newid()
SELECT *
FROM @TABLE
WHERE CONVERT(VARCHAR(255), id) = 'd65cafc-1435-45d3-acce-dc464f02c4b1'
How's that?
July 28, 2010 at 9:35 am
Isnull is your friend 🙂
SELECT 'ActiveProd' = Isnull((SELECT COUNT(*)
...
July 28, 2010 at 7:25 am
INTs don't have 0's padding. If you want to keep them, you'll have to use something else, e.g. VARCHAR.
July 14, 2010 at 8:56 am
Gianluca Sartori (7/14/2010)
skcadavre (7/14/2010)
Something tells me that I may have just answered a homework question :Whistling:
Not sure. It's not typical quoting object names with square brackets in homework...
I could be...
July 14, 2010 at 7:39 am
John N (7/14/2010)
result:
custname
scott
scotty
scot
....
This is what i'm looking for but is this the right contxt to use soundex? or should i...
July 14, 2010 at 6:36 am
July 14, 2010 at 6:22 am
Eugene Elutin (7/14/2010)
Check what will happen if you add 1.10 or 2.10...
July 14, 2010 at 6:17 am
p.ravirao (7/14/2010)
Thanks!When i am modifying your query like below. I am getting zero rows.
There's no data in the table variable that you've created there, so it will return zero rows.
July 14, 2010 at 6:13 am
OK. Looks to me like you're pretty new to SQL. So, can I suggest that you take some time out to ensure you understand how both examples work?
;WITH cte (...
July 14, 2010 at 6:09 am
p.ravirao (7/14/2010)
Hi,I have last question, how can i make this query for dynamic data instead of sample static data.
ex: select the rows from the table.
Thanks again..
I'm guessing here, but do...
July 14, 2010 at 6:01 am
p.ravirao (7/14/2010)
Hi,I want write one more select query like below:
I've actually already answered this in the thread you started on it, go check 😉
July 14, 2010 at 5:48 am
Assuming I've understood you correctly, this should be what you want.
--Once again, I'll build your test data first
DECLARE @TABLE AS TABLE(
[RequestID] INT,
[RequestItemID] INT,
[CostLocal] FLOAT,
[Qty] INT,
[Total_doller] FLOAT)
INSERT INTO @TABLE([RequestID],[RequestItemID],[CostLocal],[Qty],[Total_doller])
SELECT 331, 1036,...
July 14, 2010 at 5:46 am
Viewing 15 posts - 1,831 through 1,845 (of 2,007 total)