Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Devps,
how can i reduce duplicate of rows in following group table when i asign more then one city to users(manager or excutive) , in my original db i have 10 to 20 citys for a single user,so do i need to duplicate 20 rows or is there any method to handle in a single row
like
match(city,'HYD','BNG')
i have attached the sample file and db modal please check once.
Section Access;
LOAD * INLINE [
ACCESS, UserID, ORDER,ROLEORDER
ADMIN,ADMIN,1,1
USER,MANAGER,2,2
USER,EXCUTIVE,3,3
USER,SUPERVISOR,4,4
];
Section Application;
STAR is *;
Group:
Load * Inline [
ORDER,CARCITY,BIKECITY
1,*,*
2,"HYD","HYD"
2,"BNG","BNG"
3,"HYD","HYD"
];
Cars:
LOAD * Inline [
Carname,CARCITY,CARPERSON
Honda,HYD,NARSIMHA
HERO,HYD,NARSIMHA
Maruti,BNG,PRASAD
Maruti,KOlKOTTA,PRASAD
];
Bikes:
LOAD * Inline [
BikeName,BIKECITY,BIKEPERSON
Honda,BNG,NARSIMHA
Tvs,HYD,PRASAD
Tvs,KOlKOTTA,PRASAD
];
like below
Group:
Load * Inline [
ORDER
1
2
3
];
left join(Group)
Carcity:
Load ORDER,
Subfield(CARCITY,',') as CARCITY
Inline [
ORDER,CARCITY
1,"*","*"
2,"HYD,BNG"
3,"HYD,BNG,MUM"
];
use left join ! from User to City that is it
user means the group table u mean ? can you please write query once
If you already have those Cities listed per User in your DB, then why don't you just make a copy of this database table and call it Group?
like below
Group:
Load * Inline [
ORDER
1
2
3
];
left join(Group)
Carcity:
Load ORDER,
Subfield(CARCITY,',') as CARCITY
Inline [
ORDER,CARCITY
1,"*","*"
2,"HYD,BNG"
3,"HYD,BNG,MUM"
];
hi peter,
i can call it from database but i need to reduce the number of rows for a single user in the above group table i marked the rows duplicating when user having more then one city so how to reduce from 2 rows to one row
Thank you vineeth its worked