473,406 Members | 2,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Get all Records from table1 and the correspond values from table3 verify MId table2

Table 1
ID Information
1 This is Key
2 This is Ball
3 This is Bike
4 This is Pen
5 This is Car

Table 2
ID Member
1 Chandra
2 Prasad
3 Rajesh

Table 3
ID Id.Member Id.Infromation
1 1 5
2 1 1
3 2 2
4 3 1
5 1 3
6 3 4
7 2 3

ID : Primary Key

Send the MemberID for Eg: IDà1 Depending on the ID Value Result Like This.


InformationId Information IsSelected
1 This is key True
2 This is Ball False
3 This is Bike True
4 This is pen False
5 This is Car True

So I need all the information of table1 and the related selected items from table 3 while sending the memberId.

Using SQLSERVER 2008 Need SQL Query for getting this table
Dec 29 '10 #1
3 1455
ck9663
2,878 Expert 2GB
Try using JOIN. Post what you have and we can start from there...

Happy Coding!!!

~~ CK
Dec 29 '10 #2
Thankx for giving reply
Here i am using Join like this geting all the infromation in table3 with table1 with Ischeck true or false

SELECT T1.ID As InfromationID,Infromation,
CASE WHEN MemberId= @MemberId(Eg=1) THEN 'TRUE' ELSE 'FALSE' END AS IsChecked
FROM tbltable1 T1 LEFT JOIN tbltable3 T3 ON
T1.InfromationID = T3.InfromationID

for example : in table 3 member 1 and 3 selected information 1
table having 2 rows for this and givng the correct member astrue and othe one false.
that is the problem i am facing.

thankx in advance
Dec 29 '10 #3
ck9663
2,878 Expert 2GB
On your result, where did the InformationId came from?

~~ CK
Dec 29 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: david | last post by:
Hi, Gosh I've seen this b4 but I couldn't google it, ah just found it eg search for records having same email address select txtemail,count(txtemail) from `tbl_user` GROUP BY txtemail having ...
7
by: Nicolae Fieraru | last post by:
I have two tables, they contain: Table1: ID1, Name1, Address1, Purchase1 Table2: ID2, Name2, Address2, Purchase2 I need a query which creates Table3 with content from Table1 and Table2. The...
1
by: Mark Donners | last post by:
Table1 and table 2 are in the same access database. when i press a button(script) all records from table1 should be added to table2. How can i do this? Who can help m donners
4
by: suffrinmick | last post by:
Hi everyone! I (Along with the help of some of you guys!) have managed to get a query working which takes multiple values (types of organisation) from a list box. The query returns a list of...
2
ak1dnar
by: ak1dnar | last post by:
Hi all, I am getting this error in my ASP.net App, when reading some records which contains Null values for some of the columns. System.Data.SqlTypes.SqlNullValueException: Data is Null....
4
by: paulquinlan100 | last post by:
Hi I have the following query: SELECT qryBlackbook.* FROM qryBlackbook inner JOIN qryLatestMeetingDate ON (qryBlackbook.Site_Ref = qryLatestMeetingDate.Site_Ref) AND...
2
by: JC2710 | last post by:
Hi I would like a Query that Updates a field to indicate that records have a duplicate entry( records with same values). My table is ..... Code........Process..........Quantity ...
1
by: dlee360 | last post by:
Hello! So I've been trying to figure out how to do the following in T-SQL: Orig Table: Col1 Col2 Col3 Set A ...
3
by: Tomkat53 | last post by:
Hello, I'm not sure if this has been asked here before (wouldn't know what to search for). Here's my situation... I have records in Table1 that I need to insert into Table2. However, there is...
12
by: KPR1977 | last post by:
In an Access Database for field2, the data values could consist of the following: ---field1-------------field2------- Widget 1-----112398764567 Widget 2-----987611236789 Widget...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.