Friday, December 23, 2011

selecting multiple records from two tables

selecting multiple records from two tables

SELECT MIN(TableName) as TableName, ID, COL1, COL2, COL3 ...
FROM
(
SELECT 'Table A' as TableName, A.ID, A.COL1, A.COL2, A.COL3, ...
FROM A
UNION ALL
SELECT 'Table B' as TableName, B.ID, B.COL1, B.COl2, B.COL3, ...
FROM B
) tmp
GROUP BY ID, COL1, COL2, COL3 ...
HAVING COUNT(*) = 1
ORDER BY ID

union select two tables records

union select two tables records by anil nain sonipat haryana
select*from FAMILY whereEXISTS
(select*
from FAMILY_old
where FAMILY_old.Family_Id = FAMILY.Family_Id and FAMILY_old.Family_Score<=7
)and Edit_ind isnull
//////////////////////////////////////////////////////
update family set edit_ind=null where not EXISTS
(select *
from FAMILY_old
where FAMILY_old.Family_Id = FAMILY.Family_Id and FAMILY_old.Family_Score<=7
) and Edit_ind=1
/////////////////////jyada records dhundne ke liye////////
select * from FAMILY where not EXISTS
(select *
from FAMILY_old
where FAMILY_old.Family_Id = FAMILY.Family_Id and FAMILY_old.Family_Score<=7
) and Edit_ind=1

select FAMILY.family_id, FAMILY.form_no,FAMILY.house_number,FAMILY.Name_Of_Head, villages.Village_Name from FAMILY inner join villages on villages.Village_Code=family.Village_Code where EXISTS
(select *
from FAMILY_old
where FAMILY_old.Family_Id = FAMILY.Family_Id and FAMILY_old.Family_Score<=7
) and Edit_ind is null

union select two tables records by anil nain sonipat haryana

Monday, July 4, 2011

Oracle Connectivity and DISE installation and connectivity with oracle anil nain from sonipat




installation of Oracle and DISE and their Connectivity by anil nain from sonipat


when installation oracle give default is oracle8i


step 1 start- oracle8i Network Admin

Step2 net 8 config assit

local net service name

add

oracle8i

service name - oracle8i

hostname TCP- "computer name"


system

maneger

password and user name -dise2001

dise2001


Configration-create tables space

create user

DPCSonipat

DPCsnp

rename snp to disexpt



Oracle Run-------------

Run-sqlplus-internal/oracle-startup-Exit-Exit






Magerment Calculation and Startups

Calculating area of non square pl oat by anil nain sonipat
c
b a
d
Avg of b+a/2=x
Avg of c+d/2=y
x*y=z/9

3.5 Akkad=35000 gaze
35000*9=----Square feet
35000*9*.0924=---square meters

Monday, May 2, 2011

Define parameter for commands of SqlDataSource


Define parameter for commands of SqlDataSource by anil nain 9416077273
" runat="server">DeleteCommand="DELETE FROM [Company] WHERE [ID] = @ID"
InsertCommand="INSERT INTO [Company] ([Title], [Address]) VALUES (@Title, @Address)"

SelectCommand="SELECT [ID], [Title], [Address] FROM [Company]"
UpdateCommand="UPDATE [Company] SET [Title] = @Title, [Address] = @Address WHERE [ID] = @ID">




<%--




--%>